You have to use the posts_orderby
filter to do this at the mo, eg
function wpse159469_posts_orderby( $orderby, $query ) {
return implode( ' DESC,', explode( ',', str_replace( array(' ASC', ' DESC' ), '', $orderby ) ) ) . ' DESC';
}
then around your query:
add_filter( 'posts_orderby', 'wpse159469_posts_orderby', 10, 2 );
$query = new WP_Query( array( // etc
remove_filter( 'posts_orderby', 'wpse159469_posts_orderby', 10 );
Related Posts:
- WP_Query orderby date not working
- Orderby ASC changes to DESC in WP_Query
- Complex WP_Query order request: DESC by day, but then ASC by time
- How to orderby multiple meta fields if some fields are empty
- WP_Query: Group events by year, sorted DESC; then by date for each year group, sorted ASC
- Order posts by more than one variable (meta_key and publish date AND time)
- Get post closest to today
- Order by meta values
- Get posts that were most recently tagged
- WP_Query sort by ACF date field (newest first) with blank dates first
- How to only display posts whose meta_value field is not empty?
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- Order by optional meta key?
- Sorting: custom query with orderby meta_value_num THEN by title
- 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?
- Sort Order for a Custom Query in a Post Type Archive Not Working
- Order posts by ID in the given order
- Get Recent Posts by Date in Multisite
- Is it possible to orderby multiple meta_keys when using meta_value_num?
- Custom WP_Query order by post_meta and (author) user_meta
- Sorting posts by custom date fields (non standard date format)
- WordPress Custom Query to show posts from last x years
- How to order posts tag by tag?
- How do I order pages and categories by ID or name in the same query?
- WP_Query with meta_value LIKE ‘something%’
- WP_Query ordered by custom field that is a date string?
- WP_Query sort by comment meta data
- Order posts by tags count?
- Merge 2 args in one WP_Query and order it by date
- Orderby = none not working [duplicate]
- Order by custom field date with ASC order
- WP_query ‘orderby=none’ Problem
- Order posts by date and then by custom field
- How to order a post type with meta_value_num and if meta_value_num does not exist then order by date
- Revolution Slider Orderby Two Custom Fields
- Sorting meta_value as integer doesn’t work
- Order posts ascending with number in title
- List taxonomy terms plus their latest post ordered by post date
- Order by the results of a function with WP_query
- How can I hide posts that are over 2 years old
- How to order posts in wp_query by a meta_value of the corresponding author
- Order by menu structure
- Add a default meta_value to new posts
- WP_Query order by date in meta_value
- Date query not inclusive despite parameter being true
- Use meta_query to display events by date in custom field
- How to use order RAND() on WordPress?
- Show all parents and children in custom post type in right order
- WP_Query orderby breaks when using AJAX?
- Order WP Query posts by custom order calculated from post meta values
- Custom Post order for homepage
- How to use Meta Value Compare in WP_Query For Max and Min numbers
- Custom WP Query from meta_value stored as serialised array
- Meta query with order by another custom field
- Change default ordering of taxonomy terms – pre_get_terms
- meta_query works locally but not on live server
- How to show recent and upcoming birthdays using meta_query
- Ordering Posts Type A by Custom Fields of related Post Type B
- 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?
- Wp query orderby ‘title’ doesn’t work
- Meta Query for specific months
- How can I order Wp_Query hierarchically?
- How do I sort posts with multiple pages
- Sorting posts DESC based on the number of comments using WP_Query
- WP_Query meta_query >= date
- Order WP_Query by multiple fields, subtracting them from one another
- Complex Orderby Parameters: How to query with multiple orderby parameters using meta_value_num?
- Complex date range with WP_Query and BETWEEN
- pre_get_posts order by not working
- Comparing dates in custom field
- Custom query for sidebar isn’t returning results
- Need wp_query to return all children and grandchildren
- How to display upcoming events by dat with Modern Events Calendar Lite
- (Solved) WP_Query ($ args) -> How to sort letters and numbers within the same array
- SQL: What is wrong with the following query (generated by WordPress WP_Query, ordering prices)
- Order By table field comment_status in WordPress > 4.0
- new WP_Query to get max price meta value not working
- How to set multiple `orderby` in query argument?
- WP_Query order result by date AND meta_value
- Query multiple meta values
- Order by title without taking into account ‘the’
- Why isn’t my `meta_query` array functioning properly?
- WP_Query orderby author__in
- Sort wordpress custom posts based on meta value
- Weird orderby => post__in issue
- Meta_query on same meta key, with diffrenct values
- Order by summing multiple values
- Understanding the orderby in WP_Query?
- Order by empty custom field
- How to extract specific post
- How to order posts by title after they have already been sorted by category
- Advanced ordering of query_posts