Making get_posts retrieve only posts in two categories exclusively, not inclusiv
-
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) : ?>
LOOP
<?php endforeach; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Making get_posts retrieve only posts in two categories exclusively, not inclusiv’ is closed to new replies.