• Resolved icakeov

    (@itucakov)


    Hi I have seen some posts on this topic but haven’t found the solution.

    I am passing only one category into the query (in this case 18):

    $args = array( 'offset' => 0,'numberposts' => 4, 'post_status'=>"publish",'lang' => 'en','post_type'=>"post",'orderby'=>"post_date",'order'=> 'DESC','category' => 18);
    $postslist = get_posts( $args );
    foreach ($postslist as $post) : setup_postdata($post);

    But it is displaying other posts that don’t have category 18..

    I’ve seen that wp_query works really well. Should I just switch to that?
    Or is there a known solution to this issue with get_posts?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘get_posts posting wrong post categories’ is closed to new replies.