Support » Themes and Templates » list ALL child pages

  • OffLead

    (@offlead)


    Is there a way to list all child pages, regardless of the parent ID? Barring that, is there a good way to retrieve all the parent IDs in order to list them each out within the php, without having to hard-code the IDs into the templates?

    I’ve got a handful of top level pages without parents, and some of them will have child pages. I need to be able to list them all out without their parents if possible.

Viewing 4 replies - 1 through 4 (of 4 total)
  • whree do you want to “list” them, they should show up in the default site navigation menu, under “pages” check out the code used for that, then use it where you need it. i only have two pages at the moment (not including posts), but for an example see http://www.hradil.us on the right site, under pages, that’s a list of ALL the pages I’ve created so far for the top level of the site.

    OffLead

    (@offlead)

    I don’t want all pages listed. Let’s say my page structure is thus:

    PAGES:
    – Contact Us
    — Sub Contact A
    — Sub Contact B
    — Sub Contact C
    – About Us
    — Sub About A
    — Sub About B
    – Another Page
    — Sub Another A
    — Sub Another B
    — Sub Another C

    What I want to accomplish is a menu that reads like this:

    — Sub Contact A
    — Sub Contact B
    — Sub Contact C
    — Sub About A
    — Sub About B
    — Sub Another A
    — Sub Another B
    — Sub Another C

    I don’t want the “parent” pages, only the child pages. I know how to display the child pages of a known parent (child_of=$id), but I don’t want to have to code this in for each parent page whenever I add or remove one. I would like to simply pull ALL child pages, of all the parent pages, whatever they happen to be.

    first, check: http://codex.wordpress.org/Template_Tags
    then take a look at: http://codex.wordpress.org/Plugin_API

    between the template tags and hooks/filters you should be able to come up with something close to what you’re looking for

    OffLead

    (@offlead)

    Might be able to if I could make heads or tails out of that second link. 😉

    Okay, so this might be beyond my abilities to do.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘list ALL child pages’ is closed to new replies.