Display posts that belong to two or more categories
-
Hello,
I love WP-Tiles, and I want to use it not only on the top page but also on category top pages. What I want to do there is display tiles for posts that belong to more than one category.
Real world example: The website is a travel guide and covers China, Japan etc. These countries are set up as categories. There are cross-country categories such as food, travel etc. as well. On the category top page for Japan for example, I want to display a section “Food”, including tiles for posts that belong to Japan AND Food.
Alternatively, I’d also be happy to display tiles to posts that match “Food” but exclude posts that are categorized as China (I’d have to exclude multiple categories though as there are more then 2 countries).
I tried experimenting with “category” and “posts_query” in short code, to no avail. If I determine two categories, it will display posts that belong to EITHER OR, but I need AND.
I googled a lot as I thought that many people are trying to do the same, but nothing comes up, so I guess I’m missing something essential here.
Has anyone else tried to do the same — and if yes, how?Thanks in advance
- The topic ‘Display posts that belong to two or more categories’ is closed to new replies.