Title: Error posts order in custom wp_query
Last modified: August 31, 2016

---

# Error posts order in custom wp_query

 *  [GalinaBublik](https://wordpress.org/support/users/galinabublik/)
 * (@galinabublik)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/error-posts-order-in-custom-wp_query/)
 * In version 4.4.1 ordering by date does not work properly.
    [http://take.ms/dlolw](http://take.ms/dlolw)
   [http://take.ms/i9nWT](http://take.ms/i9nWT)
 * Applying custom query returning error
    (Added order by ‘menu_order’) In case 
   with custom query [query] => Array ( [post_type] => news [post_status] => publish[
   posts_per_page] => 5 [paged] => 1 [orderby] => date [order] => DESC )
 *  [query_vars] => Array
    ( [post_type] => news [post_status] => publish [posts_per_page]
   => 5 [paged] => 1 [orderby] => date [order] => DESC [error] => [m] => … [request]
   => SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.
   post_type = ‘news’ AND ((wp_posts.post_status = ‘publish’)) ORDER BY wp_posts.
   menu_order, wp_posts.post_date DESC LIMIT 0, 5 [posts] => Array ( [0] => WP_Post
   Object ( [ID] => 830 [post_author] => 2 [post_date] => 2015-02-02 22:10:03 [post_date_gmt]
   => 2015-02-02 22:10:03 [post_content] => Our worst fear… [post_title] => What
   if my child was hurt in a car wreck? )
 *  [1] => WP_Post Object
    ( [ID] => 298 [post_author] => 1 [post_date] => 2014-
   01-01 21:48:41 [post_date_gmt] => 2014-01-01 21:48:41 [post_content] => No one
   thinks… [post_title] => Be Prepared: Know What To Do If You Are In a Car Accident)
 *  [2] => WP_Post Object
    ( [ID] => 827 [post_author] => 2 [post_date] => 2015-
   02-13 21:55:36 [post_date_gmt] => 2015-02-13 21:55:36 [post_content] => If you
   were injured… [post_title] => How to keep your health insurance from taking your
   money )
 *  [3] => WP_Post Object
    ( [post_author] => 2 [post_date] => 2015-02-20 21:50:
   14 [post_date_gmt] => 2015-02-20 21:50:14 [post_content] => Look around… [post_title]
   => Are City Snow Plows Immune From Negligence Liability?
 *  )
 *  [4] => WP_Post Object
    ( [post_author] => 1 [post_date] => 2015-01-01 00:22:
   13 [post_date_gmt] => 2015-01-01 00:22:13 [post_content] => Happy New Years Eve!…[
   post_title] => Three Easy New Year Resolutions to Add to Your List and Build 
   Momentum
 *  )
 *  )
 *  [post_count] => 5
    Checked older version – order by date working fine. Please
   check and correct.
 * [https://wordpress.org/plugins/posts/](https://wordpress.org/plugins/posts/)

The topic ‘Error posts order in custom wp_query’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/posts.svg)
 * [Post Next](https://wordpress.org/plugins/posts/)
 * [Support Threads](https://wordpress.org/support/plugin/posts/)
 * [Active Topics](https://wordpress.org/support/plugin/posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts/reviews/)

## Tags

 * [order](https://wordpress.org/support/topic-tag/order/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)

 * 0 replies
 * 1 participant
 * Last reply from: [GalinaBublik](https://wordpress.org/support/users/galinabublik/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/error-posts-order-in-custom-wp_query/)
 * Status: not resolved