WordPress.org

Ready to get started?Download WordPress

Forums

Does wp_list_pages work on Child pages w/ children? (1 post)

  1. helgatheviking
    Member
    Posted 4 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 4 years ago by helgatheviking
  • This topic is not resolved
  • WordPress version: 2.9.1