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?
- Order by optional meta key?
- 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
- Get Recent Posts by Date in Multisite
- How do I order pages and categories by ID or name in the same query?
- Merge 2 args in one WP_Query and order it by date
- Order by custom field date with ASC order
- Revolution Slider Orderby Two Custom Fields
- Order posts ascending with number in title
- List taxonomy terms plus their latest post ordered by post date
- How can I hide posts that are over 2 years old
- Add a default meta_value to new posts
- Use meta_query to display events by date in custom field
- How to use Meta Value Compare in WP_Query For Max and Min numbers
- Meta query with order by another custom field
- meta_query works locally but not on live server
- How to show recent and upcoming birthdays using meta_query
- 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?
- How do I sort posts with multiple pages
- Order WP_Query by multiple fields, subtracting them from one another
- Complex date range with WP_Query and BETWEEN
- pre_get_posts order by not working
- Comparing dates in custom field
- How to display upcoming events by dat with Modern Events Calendar Lite
- WP_Query order result by date AND meta_value
- Order by title without taking into account ‘the’
- WP_Query orderby author__in
- Weird orderby => post__in issue
- Meta_query on same meta key, with diffrenct values
- How to extract specific post
- 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
- Meta Query relation “AND” then set array accordingly
- Taxonomy and Date in same query?
- date_query seems to be ignored by wp_query
- WP Group posts by year(desc) > month(desc) > date(asc)
- WP Query – order posts by meta field first and then order the rest
- Advanced WP_Query with meta_query, orderby?
- Specify strict ‘order by’ in WordPress query
- Order is breaking wp_query
- Filtering posts by archive showing all years
- WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?
- query post by author gender
- How order posts from category by date and comment count?
- Ordering posts by custom field and grouped by month
- Filtering by multiple conditions in the loop
- Limit loop to future events
- Show single posts date, in a page of posts
- Orderby two meta fields not working
- Added Date Filter To Popular Posts Query
- WP_Query order by multiple meta keys & fields
- Save queried result into database
- WP_Query multiple value not working
- Custom order of posts in wp_query and different taxonomies
- WordPress Query custom ordering by temporary variable
- Comparing Meta Field date in WPQuery using Meta_Query?
- Custom order revolution sliders post base slides as inserted in Specific Posts List field
- WP_User_Query Orderby Not Working
- How to get only present and past posts with post_date
- Order by meta date with a thousanth of a second defaults to post order
- Query Order By Number Variable From API
- How to get_comments() ordered by date and parent?
- Order 2 meta_queries differently in WP_Query?
- Gather same custom field values in one value in a select tag with wp_query
- Order & Orderby clause not working with custom query
- Best way to Order Post in Home without a plugin
- Query All Attachments and Order by Parent Publish Date
- how to query for meta_value have array
- Sorting Posts with meta value not working
- Order posts by custom column using pre_get_posts
- Add filter to Orderby Parameter using Array
- Order WP_Query results in order other than ASC or DESC
- Show sticky post before other WP_Query
- Custom query to order by multiple taxonomies
- Sorting: custom query with orderby meta_value_num THEN by title
- orderby in WP_query doesn’t works
- orderby and order filter in get_posts or WP_query function in wordpress not working
- Get posts by meta value except one post [closed]
- Why does wp_query only display the most recent post when using order ASC?
- How to put posts with some taxonomy on top of others in `pre_get_posts`
- new WP_Query with order args – no more distinction between categories