WordPress.org

Ready to get started?Download WordPress

Forums

Post Types Order
[resolved] Not working using get_posts function (3 posts)

  1. logicred
    Member
    Posted 8 months ago #

    Re-ordering works fine in back end, but when I use a get_posts function the new order is not retained:

    get_posts('numberposts=10&category=6')

    It is still ordering by ID. I can use the 'orderby' and 'order' params, but none of these reflect the re-ordering used by this plugin. Thanks!

    http://wordpress.org/plugins/post-types-order/

  2. nsp-code
    Member
    Plugin Author

    Posted 8 months ago #

    Try including the 'suppress_filters' => FALSE within the parameters.

  3. logicred
    Member
    Posted 8 months ago #

    Thanks! Interesting, but possible bug in WP...

    THIS WORKS

    $args = array( 'posts_per_page' => 10, 'suppress_filters' => false, 'category' => 6 );

    THIS DOES NOT (it works, but the suppress_filters has no effect).

    $lastposts = get_posts('numberposts=10&category=5&suppress_filters=false');

Reply

You must log in to post.

About this Plugin

About this Topic