How to only show children of Pages? (4 posts)

  1. indigowhite
    Posted 11 years ago #

    I wish to have a site with pages and subpages. How do I make so the top Pages only show up in the index, and when you click on a Page, only show the children of that page?

    I've searched a lot for a answer to the question, but I can't find any. Please someone, take your time to explain to me, please please

  2. prissed
    Posted 11 years ago #

    I did the same thing on my site. Here's what I did.

    On my sidebar I did this:

    <?php wp_list_pages('depth=1&title_li=<h2>' . __('Pages') . '</h2>' ); ?>

    Then I got the php-exec plugin, and on each top-level page, I used this code:


    Where the "9" in 'child of=9' is the page id number of each top-level page.

    I don't know if there are other ways to do this (I'm sure there are), but this was the easiest way for me. :)

  3. alastc
    Posted 11 years ago #

    That looks like a good way of doing it within wordpress' artitechture, but I wanted something a bit more dynamic. I put something together that was an included file in the sidebar, described here:

  4. starflyer3000
    Posted 10 years ago #


    I wanted to let you know that I tried your suggestion on my site and it looks like it will work perfectly. Thanks!


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.