WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If the main query args look like this:

'orderby' => 'meta_value_num',
'meta_key' => 'price',
'order' => 'DESC'

What orderby does the query use if the meta_key value is the same for multiple results? So, in the above example, if multiple items have the same price, how does the query order those items? Like a sub-orderby... I thought it would be publish date, but it isn't.

share|improve this question
If i'm not mistaken, you can use multiple orderby values. So you could say orderby => 'meta_value_num title' You can read more about that here: WP_Query Orderby – Howdy_McGee Jan 21 '14 at 22:27
Thanks for the response @Howdy_McGee. Unfortunately, that doesn't seem to work if you specify a meta_key. The examples in the Codex for the fallback orderby parameter use only orderby and order and skip the meta_value or meta_key arguments. What happens is that orderby defaults to ASC when you add a fallback to orderby if meta_key is present. – chazbeaner Jan 22 '14 at 9:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.