WordPress.org

Ready to get started?Download WordPress

Forums

get_post Does Not Return Correct Results (1 post)

  1. PigMonkey
    Member
    Posted 3 years ago #

    I have a custom content type called 'rs_invoice'. There are six posts with this type. Their IDs are: 960, 950, 910, 890, 1069, and 1070.

    Using WP_Query correctly returns all of these posts.
    $invoices = new WP_Query( array('post_type' => 'rs_invoice') );

    Using get_posts returns all but 1070.
    $invoices = get_posts( array('post_type' => 'rs_invoice') );

    Why would WP_Query and get_posts, given identical arguments, return different results?

Topic Closed

This topic has been closed to new replies.

About this Topic