Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Kristoff1875 on "Filter posts by 2 parent categories?"

$
0
0

Hi guys, i'm a novice at Wordpress, please bare with me.

Say we have 2 Parent categories CatA and CatB, and 2 dropdown selections that each contain the child categories CatAdropdown contains CatA child categories and CatBdropdown contains CatB child categories, would it be possible to filter results by using both of these? So once you choose an option from each dropdown and click go, you get posts that only have both categories selected? I'm thinking something along the lines of when you send the query:

if ((CatA == 1) && (CatB == 7)) { query_posts(array('category__and'=>array(1,7))); }

Would something like this be possible?

Thanks in advance


Viewing all articles
Browse latest Browse all 8245

Trending Articles