Query Child Posts Even if Parent Isn't Checked
-
**Please Read**
The title is kind of confusing/misleading. Here’s my situation: I have 2 categories, 1 containing cities and the other ones are just regular categories like Food. Right now I am querying posts depending on city and category like:
query_posts(array( 'category__and' => array($category, $city)
which works fine.I run into trouble when I have sub-categories.
**Example**
I have a city category called “New York” and a normal category called “Food” with 2 sub-categories called “Fries” and “Burgers“.The Admin makes a post and check the categories “Fries” and “New York” so the parent category is not checked.
If I click on “Food” and then further click “New York” I got a 404 because there are no posts with food AND new york, but if I click “Fries” and then “New York” the post shows up fine.
————————————————-
How do I get sub-posts to trickle back up to the parent when I query both category & city?
- The topic ‘Query Child Posts Even if Parent Isn't Checked’ is closed to new replies.