I have a taxonomy wp_query and i would like to order the list by title and by meta value (numeric value)
- Have a meta value Interesting = 1 or 0 in the posts
- Not so interesting posts would be at the bottom of the query
GOAL – OUTPUT LIKE THIS: (is this possible with WP_QUERY and WP3.1)
A ( META KEY interesting = 1)
B ( META KEY interesting = 1)
C ( META KEY interesting = 1)
A ( META KEY interesting = 0)
B ( META KEY interesting = 0)
You can filter the
orderby
part of the query to get what you want (trying to pass it via theorderby
parameter will not work, it will be filtered out). This simple example adds themeta_value
sort order before the standard title sort order.you can’t mix ascending and descending order, but if you switch the zeroes and ones then this might work: