WordPress.org

Support

Support » Themes and Templates » Using get_posts for 2 categories

Using get_posts for 2 categories

  • I’m trying to extract the posts which belong to 2 categories (an issue and a topic). The post needs to belong to both categories to be displayed.

    I’ve tried

    global $latestissuecat;
    $latestissuecat = 25;
    get_posts('offset=0&category='.$latestissuecat.',12');

    (to return all posts which are in both categories 25 and 12) but this seems to return all the posts in category 25 regardless of ccategory 12. Is there a way to do this properly or do I have some kind of syntax error in the above code?

  • The topic ‘Using get_posts for 2 categories’ is closed to new replies.
Skip to toolbar