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

I'm using this bit of code to generate a page full of items but they won't sort into the menu order, any ideas as to why?

   <?php $pages = get_pages(array('child_of', 'menu_order')); ?> 
share|improve this question
Why did you create $arg for arguments and didn't use it? – Rilwis Jun 8 '11 at 14:23
That makes no sense, check the codex for the right syntax! codex.wordpress.org/Function_Reference/get_pages – Horttcore Jun 8 '11 at 14:59
up vote 6 down vote accepted

It should look like this:

<?php $pages = get_pages( array('sort_column' => 'menu_order') ); ?>

share|improve this answer

Your Answer


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.