Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to order custom posts by meta_value_num then date using the following query:

            $args = array(
                'posts_per_page' => '-1',
                'post_type' => 'case_study',
                'tax_query' =>
                        'taxonomy' => 'procedure_category',
                        'field' => 'slug',
                        'terms' => $term->slug
                'order' => 'ASC',
                'orderby' => 'meta_value_num date',
                'meta_key' => 'order_priority'      

The trouble is it's excluding any posts without the order_priority meta key. Is there a way to to include the excluded posts?

share|improve this question
You probably will need a second query to do this...Because once you set the meta key, that is what the query is looking for. –  splashingpixels Aug 31 '13 at 15:04

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.