How do I make get_posts retrieve posts that are simultaneously in categories 1 and 2? The code below will get the intersection but also those posts in categories 1 and 2 alone.
<?php $posts = get_posts(‘numberposts=10&category=1,2’);
foreach($posts as $post) : ?>
<?php endforeach; ?>
- The topic ‘Making get_posts retrieve only posts in two categories exclusively, not inclusiv’ is closed to new replies.