id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses 9979 WP_Query orderby and order options not used as expected beaulebens ryan "In WP_Query, ""orderby"" allows you to specify multiple columns, separated by spaces, to order your results by. You can only specify a '''single''' ""order"" value (ASC or DESC). If you specify multiple values in ""orderby"", ""order"" is applied to the end of the list, or effectively to the '''last''' ""orderby"" column. e.g. If a custom query specifies: 'orderby' => 'title date', 'order' => 'DESC' it probably meant ORDER BY post_title DESC, post_date DESC (or maybe ASC, it's ambiguous), but I'll actually get: ORDER BY post_title, post_date DESC With MySQL's implied ASC on ORDER BY statements, this is the opposite of what I really wanted. We should either drop support for multiple-column ordering, allow for a way to specify a sort order per orderby/column, or at the very least apply the ""order"" to the '''first''' column specified, which seems like it'd be more likely to be intended outcome. See Also: #9978 for a sticky post bug that will need to implement this ordering logic as well." enhancement closed low Query 2.8 minor duplicate has-patch needs-testing 3.3-early