Query Posts that are in 2 different categories
-
I want to use the query posts function in my sidebar.php to display the most recent 5 posts that appear only in both category id 3 and 7. I have the following but it shows all posts in both categories.
<?php query_posts(‘cat=3&7&showposts=5’); ?>
- <h2>Recent Posts</h2>
-
<?php while (have_posts()) : the_post(); ?>
- ‘><?php the_title(); ?>
<?php endwhile; ?>
How do you query “if in category 3 and 7” show posts in the case above?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Query Posts that are in 2 different categories’ is closed to new replies.