• Hi

    I’m using wp_get_recent_posts to get latest posts, but now I need to filter them out from specific categories

    Right now I have

    $args = array( 'numberposts' => 15 );
    $recent_posts = wp_get_recent_posts( $args );

    I tried

    $args = array( 'numberposts' => '15' , 'category' => '134' );
    $recent_posts = wp_get_recent_posts( $args );

    Where 134 is the ID of the category I want to get posts, but nothing shows up…

    I have 2 main categories and on each one several child categories.

    I need to get the latest posts from all the child categories from one of the main categories, how can I accomplish that?

    cheers

  • The topic ‘use wp_get_recent_posts to get latest posts from specific categories’ is closed to new replies.