What I'm Doing
I have a cities category and normal categories. Right now I have them filtering by category, then when the user clicks a city it will filter by category AND city
query_posts(array( 'category__and' => array($city, $category))
The Problem
That works - no problem. The problem comes when I add sub-categories to my main $categories
and the admin does not check the parent.
Example
I have a main category: Food
and 2 sub-categories Fries
& Burgers
. I also have a city category called New York
. The admin adds a post and checks Fries
and New York
so by default wordpress will pull up this post. When the user tries to filter it by city (New York
) it says there's no posts because the parent was never checked.
How do I Bring that sub-category post to the top when the user filters the parent category by city?
I apologize if it is confusing so ask questions if needed. Thanks in advance!