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 am trying to use the orderby parameter in the get_children function as below:

$navigation = get_children(array(
  'post_parent' => $parent->ID,
  'orderby' => 'menu_order'

But it is having no effect on the result; it is still ordering by the default creation date.

Any ideas?

share|improve this question
up vote 7 down vote accepted

Are you sure you need this specific function? Documentation (both Codex and inline) is verrry confusing. And it supposedly fetches things like attachments, which probably aren't relevant for navigation...

Try this:

get_posts( array(
    'post_type' => 'page',
    'post_parent' => $parent->ID,
    'orderby' => 'menu_order'
) );
share|improve this answer

The 'orderby' argument should work with get_children() because get_children() is really just a wrapper around get_posts() with a different set of defaults. The menu order refers to the Order specified in the Page Attributes meta box when editing a Page... not to the order you've sorted a custom menu into.

share|improve this answer

You can use the $args in get_children, but ensure you also specify the post ID that you want to retrieve children from, even if it is the current page children you want

get_children( array(
    'post_parent' => $post->ID,
    'orderby' => 'menu_order',
    'order' => 'ASC'
share|improve this answer
How does this address the question? The OP claims that the order is still by creation date even though the original code has an orderby parameter? – s_ha_dum Apr 26 '13 at 15:42

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.