- This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
(Not sure if this questions belongs in wordpress or php)
I am filtering wordpress posts on a template using:
I need to filter
list based on the page or category. ie On page "36" the list should only display categories "3" and the sub-categories under "3".
I think I am close. I used the same if statement in the sidebar file to set a variable $cat
and then I call
But I am getting the following error:
I can hard code the "include" into the
and it works fine.
Can you not pass a variable into this statement?
Any assistance is appreciated.
Seth
The "include" parameter wants a string, not an array. Just give it "3" instead of array(3). If you need multiple, just comma separate, like "3,4,5"
So I was making it too complicated.
You have to call the hook during the if statement. ie
It will still need to be hard coded if the site changes but at least it works for now.
Thanks Chris. Love the screancasts. You have saved my bacon more then once.