Support » Fixing WordPress » get_pages

  • Hi all,

    This is my structure. So I have 3 levels navigation.

    parent > children > grandchildren

    I want to call all the children from the parent page. But not the granschildren. So just a depth of 1. However depth does not work with get_pages.

    Here is my code:

    $args = array(
    'child_of' => $post->id,							  'depth'  => 1,							  'sort_column' => 'menu_order'
    );
    
    $children=get_pages($args);

    This gets all the child and granschild pages of the page I am on (I am on the parent page).

    I just want the children.

    If I add

    'parent' => 0,

    That shows all the parent pages. So the 1st level navigation.

    If I add

    'parent' => 1,

    That shows nothing.

    If I add

    'depth' => 1,

    That does not do anything.

    Any ideas kind people?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘get_pages’ is closed to new replies.