Include posts with two specific categories on a page
-
Is there a way I can include posts on a page that have two specific categories attached to them. So they only show up if they have those two categories attached and don’t show if they have just one of the two?
For example: I’m creating a site with pages for multiple artists. Each artist can post their albums under their own category (Artist1) and in the category Albums. So I want the posts to show of their own albums on their own pages and not on the other artists pages.
Is their a way to solve this without having to exclude the other categories? I’m now using this query_posts tag:
<?php query_posts('category_name=Artist1&category_name=Albums'); ?>
But this calls up posts containing one of the two categories.
Thanks
- The topic ‘Include posts with two specific categories on a page’ is closed to new replies.