Support » Fixing WordPress » Specifying more than one category condition for get_posts

  • I would like to generate a list of posts if they exist in two categories.

    Is it possible to do something like this?


    <?php
    $posts = get_posts('category=1&category=2');
    foreach($posts as $post) :
    setup_postdata($post);
    ?>

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Specifying more than one category condition for get_posts’ is closed to new replies.