WordPress.org

Ready to get started?Download WordPress

Forums

Using get_posts for 2 categories (1 post)

  1. Robinj
    Member
    Posted 6 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic