Since version 4, you can order by multiple fields via an array:
'orderby' => array( 'meta_value_num' => 'ASC', 'date' => 'DESC' )
Related Posts:
- SQL: What is wrong with the following query (generated by WordPress WP_Query, ordering prices)
- Order by summing multiple values
- Debugging wp_query orderby for taxonomy
- Randomly select one of last 3 posts
- orderby in WP_query doesn’t works
- WP_Query with several meta_query-statements and order by meta_value
- WP_Query with “post_title LIKE ‘something%'”?
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- WP_Query orderby date not working
- Order by DESC, ASC in custom WP_Query
- WP_Query order by multiple meta keys & fields
- Secondary Sort (fallback) for WP_Query
- Query Posts in a Predefined Order
- How to get order of posts?
- Is it possible to wrap Geo Location search around WP_Query?
- Is it possible to select against a post’s parent’s fields with WP_Query?
- How do I order pages and categories by ID or name in the same query?
- WP_Query ordered by custom field that is a date string?
- How to make an activities stream mixing posts and comments?
- SQL Statement generated by WP_Query not producing expected results
- What is an efficient way to query based on post_meta?
- Merge 2 args in one WP_Query and order it by date
- SQL query equivalent to WP User Query
- Order posts ascending with number in title
- List taxonomy terms plus their latest post ordered by post date
- Advanced WP Query hogs the SQL server
- How to use order RAND() on WordPress?
- WordPress WP_Query orderby being overwritten
- WP_Query Order by Specific Post ID First
- Order Posts by meta value AND published date
- How can I pick a single post from the latest 3?
- Query post with meta_query where date is not in future
- How do I sort posts with multiple pages
- Order WP_Query by multiple fields, subtracting them from one another
- pre_get_posts order by not working
- How To Fix WP Query Returns Results But Shouldn’t?
- List of the years with posts presented
- Orderby ASC changes to DESC in WP_Query
- Complex WP SQL Query
- WP_Query order result by date AND meta_value
- Optional Meta Query
- Order by title without taking into account ‘the’
- Sorting events by descending date, and ascending time if multiple events on a date
- WP_Query orderby author__in
- Editing the default wordpress search
- Weird orderby => post__in issue
- How to extract specific post
- Woocommerce – Changing the order of the upsell products [closed]
- Changing sort order for presentation by Jetpack infinite scroll
- How to order posts by title after they have already been sorted by category
- Advanced ordering of query_posts
- meta_value_num not ordering all items
- Include data from custom table in WP_Query
- Is it possible to query from external database? [duplicate]
- WP Query – order posts by meta field first and then order the rest
- Make a SQL query with wpdb in WordPress
- Advanced WP_Query with meta_query, orderby?
- List of ways to access WordPress database?
- Specify strict ‘order by’ in WordPress query
- Getting rid of unwanted nonSQL syntax characters when debugging a query
- How I can change the condition or compare operator for WP_Query in pre_get_posts
- Order is breaking wp_query
- Query where ANDing slug values not working
- WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?
- How order posts from category by date and comment count?
- Orderby two meta fields not working
- How to avoid filling up an array each time I run a WP_query?
- How to SQL query posts IDs by categories AND authors?
- SQL query injection with fifu image
- WP_Query order by multiple meta keys & fields
- WP Query – grouping posts by same meta key, adding together values from another key
- Custom order of posts in wp_query and different taxonomies
- What is the equivalent WP_Query of a SQL Query?
- WordPress Query custom ordering by temporary variable
- Custom order revolution sliders post base slides as inserted in Specific Posts List field
- WP_User_Query Orderby Not Working
- Order by meta date with a thousanth of a second defaults to post order
- Translating WP query into to SQL query
- Query Order By Number Variable From API
- How to get_comments() ordered by date and parent?
- Order 2 meta_queries differently in WP_Query?
- Filtering posts for unique titles, only the most recent
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- How to search CPTs in draft using get_page_by_title()
- Order & Orderby clause not working with custom query
- What argument does my function need to echo get_results() query results
- Best way to Order Post in Home without a plugin
- Order Custom Field by Price
- Show sticky post before other WP_Query
- WP Query to order posts by multiple meta fields
- Custom query to order by multiple taxonomies
- Sorting: custom query with orderby meta_value_num THEN by title
- Order by multiple meta keys on wordpress
- Custom WP_Query with SQL directives for getting posts by authors and terms
- How to return value from sql and display it
- Order by meta values
- Convert a WP Query into a simpler SQL query to fetch only COUNT of posts
- orderby and order filter in get_posts or WP_query function in wordpress not working
- How to put posts with some taxonomy on top of others in `pre_get_posts`
- WP_Query sort by ACF date field (newest first) with blank dates first