11

Is it possible to sort pages in the loop using the admin's order field (under page attributes)?

1 Answer 1

29

Yes, use the orderby and order clause in your query posts.

query_posts( array('orderby'=>'menu_order', 'order' => 'ASC' ) );

See: WP_Query#Order for reference

1
  • 3
    Please note that you also need to use order argument, example: 'order' => 'ASC'. Commented Dec 29, 2015 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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