How do you use orderby with meta_query in WordPress 3.1?

the new meta_query array selects which posts the query returns. So yes, you are indicating the ‘key’ within that meta_query, but you can still use the old method of

'orderby' => 'meta_value', 
'meta_key' => '_events_meta',

in addition to the meta_query, as these lines indicate how to sort the resulting query. So yes, you might indicate the same meta_key twice.

Leave a Comment