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.

We can order pages by title.

Also we can sort them by menu_order.

Is it possible, to order pages by menu_order and title at the same time?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

Use 'orderby' => 'title menu_order' or &orderby=title menu_order (depending of the syntax you use for your query parameters).

share|improve this answer
    
Wow. Does that work? I'll have to try it out... It doesn't look like it should from the source... –  goldenapples Oct 19 '10 at 21:20
    
See line 2139, wp-includes/query.php –  sorich87 Oct 19 '10 at 21:54
    
Yup, its in there. Thanks - I never realized that was possible! –  goldenapples Oct 20 '10 at 16:52
    
It doesn't seem to be documented anywhere. I actually discovered it while browsing through the code. :) –  sorich87 Oct 20 '10 at 18:15
    
wow... didn't know. looked in the codex and learned alot: none makes it empty and it really is an array exploded by spaces. already added it to the codex. –  kaiser Feb 4 '11 at 5:10

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.