WordPress.org

Support

Support » How-To and Troubleshooting » Does wp_list_pages work on Child pages w/ children?

Does wp_list_pages work on Child pages w/ children?

  • When I try to use wp_list_pages(include=700) -where 700 is a child itself- it only returns the page with ID=700, w/o 700’s children. Or if I use wp_list_pages(include=700, 701, 702, 703) -where 701,702 and 703 are children of 701, they all display but I lose the hierarchy. Or I can do the wp_list_pages(child_of=700) but then I lose the parent page.

    Is there a way to display a child and its children (essentially grandchildren) using wp_list_page? I’ve checked the codex, but can’t seem to figure it out. I tried this code snippet:

    http://codex.wordpress.org/Template_Tags/wp_list_pages#List_parent_Page_and_all_descendant_Pages

    and that seems to work for a top level page, but again a child page displays itself and its children w/ no hierarchy.

    My site has 3 levels of pages: Parent, Child and Grandchild and I’d like to be able to make lists of the grandchildren, but only for certain children.

    Essentially my page structure looks like this:

    Parent 1
    Child 1
    Grandchild 1
    Grandchild 2
    Child 2
    Grandchild 1
    Grandchild 2
    Child 3
    Parent 2

    I’d like to be able to generate lists like:
    Child 1
    Grandchild 1
    Grandchild 2

    Thanks in advance!

  • The topic ‘Does wp_list_pages work on Child pages w/ children?’ is closed to new replies.