WordPress.org

Ready to get started?Download WordPress

Forums

Q2W3 Post Order
[resolved] get_posts doesn't works correctly. (2 posts)

  1. peco
    Member
    Posted 2 years ago #

    This plugin works fine in archive.php but doesn't work correctly when I use get_posts function in other template.

    For example, when I wrote the following codes in index.php, post order will be the default order.

    $args = array(
                  'post_type' => 'post',
                  'posts_per_page' => '10',
                  'category' => '5'
                  );
    get_posts($args);

    Is there any way to use code like 'orderby=q2w3-post-order' in this plugin?

    http://wordpress.org/extend/plugins/q2w3-post-order/

  2. Max Bond
    Member
    Plugin Author

    Posted 2 years ago #

    Hello!

    This is not a bug. Set parameter 'suppress_filters' => false when using get_posts() or use query_posts() function (better).

    get_posts uses 'suppress_filters' => true as default, while query_posts() applies filters by default

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic