Title: posts order
Last modified: August 31, 2016

---

# posts order

 *  Resolved [ozhovnir](https://wordpress.org/support/users/ozhovnir/)
 * (@ozhovnir)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/posts-order-9/)
 * This may be a silly question, but after installing the plugin the widget is displaying
   the oldest posts instead of the most recent ones. I can’t seem to find a setting
   to reverse the order. How can I change it so it’s actually displaying the most‘
   recent’ posts?
 * [https://wordpress.org/plugins/recent-posts-widget-with-thumbnails/](https://wordpress.org/plugins/recent-posts-widget-with-thumbnails/)

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

 *  Plugin Contributor [Martin Stehle](https://wordpress.org/support/users/hinjiriyo/)
 * (@hinjiriyo)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/posts-order-9/#post-7258367)
 * I think some other function hooks in the filter ‘rpwwt_widget_posts_args’ or 
   is mixing up the sort direction in other ways. hat is possible because the plugin
   does not set the sort direction explicitely.
 *  Thread Starter [ozhovnir](https://wordpress.org/support/users/ozhovnir/)
 * (@ozhovnir)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/posts-order-9/#post-7258368)
 * So you’re saying that by default it should be displaying the most recent first?
 *  Thread Starter [ozhovnir](https://wordpress.org/support/users/ozhovnir/)
 * (@ozhovnir)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/posts-order-9/#post-7258374)
 * I don’t see anything hooking into the filter, how else can I make sure it actually
   displays most recent posts first?
 *  Plugin Contributor [Martin Stehle](https://wordpress.org/support/users/hinjiriyo/)
 * (@hinjiriyo)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/posts-order-9/#post-7258421)
 * I do not know what the reason for your experience is but there is a way to fix
   it: please insert at the end of the functions.php these lines:
 *     ```
       /**
        * Tells the plugin 'Recent Posts Widget with Thumbnails' explicitely
        * to sort the posts from new to old
        *
        */
       function rpwwt_force_desc_sortorder ( $query_args ) {
           $query_args[ 'order' ] = 'DESC';
           return $query_args;
       }
       add_filter( 'rpwwt_widget_posts_args', 'rpwwt_force_desc_sortorder' );
       ```
   
 * That way the plugin gets the explicit call to sort new-to-old.
 *  Thread Starter [ozhovnir](https://wordpress.org/support/users/ozhovnir/)
 * (@ozhovnir)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/posts-order-9/#post-7258424)
 * Thank you, that works.
 *  [Pilar Mera](https://wordpress.org/support/users/decrecementofeliz/)
 * (@decrecementofeliz)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/posts-order-9/#post-7258466)
 * Hi. Thank you very much in advance for your time.
 * I have a similar issue: posts are not being ordered by date, but that’s only 
   happening in single posts view. I’ve added your function (including also $query_args[‘
   order’] = ‘date’;) but still the same:
    [http://escolessantcugat.com/es/noticias/](http://escolessantcugat.com/es/noticias/)(
   archive view – works fine) [http://escolessantcugat.com/es/existe-el-enamoramiento-entre-los-ninos-pequenos/](http://escolessantcugat.com/es/existe-el-enamoramiento-entre-los-ninos-pequenos/)(
   single view – not working)
 * It’s weird because the widget should display the same posts in both archive and
   single pages right?
 * Thanks,
    Pilar
 *  Plugin Contributor [Martin Stehle](https://wordpress.org/support/users/hinjiriyo/)
 * (@hinjiriyo)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/posts-order-9/#post-7258467)
 * Hola, Pilar, my silly question: is the “random order” checkbox activated?
 *  [Pilar Mera](https://wordpress.org/support/users/decrecementofeliz/)
 * (@decrecementofeliz)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/posts-order-9/#post-7258471)
 * Hi Martin, thanks for answering.
 * I have solved the issue: The random order was due to a previous function included
   in my theme that makes some post-types to show always in random order. The function
   excluded the blog page, but not the single pages for regular posts. I have just
   added `!is_single()` to the `if` statement of the function and now your plugins
   works fine in all views.
 * Thanks again,
    Pilar
 *  Plugin Contributor [Martin Stehle](https://wordpress.org/support/users/hinjiriyo/)
 * (@hinjiriyo)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/posts-order-9/#post-7258473)
 * Glad to hear that.

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

The topic ‘posts order’ is closed to new replies.

 * ![](https://ps.w.org/recent-posts-widget-with-thumbnails/assets/icon-256x256.
   png?rev=2478511)
 * [Recent Posts Widget With Thumbnails](https://wordpress.org/plugins/recent-posts-widget-with-thumbnails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/recent-posts-widget-with-thumbnails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/recent-posts-widget-with-thumbnails/)
 * [Active Topics](https://wordpress.org/support/plugin/recent-posts-widget-with-thumbnails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/recent-posts-widget-with-thumbnails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/recent-posts-widget-with-thumbnails/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [Martin Stehle](https://wordpress.org/support/users/hinjiriyo/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/posts-order-9/#post-7258473)
 * Status: resolved