WordPress.org

Support

Support » How-To and Troubleshooting » List of sub pages on parent page

List of sub pages on parent page

  • On my old blog, I used to use Flexi Pages widget, but I’m trying to get away from that.
    I’m now using a modified twentyten theme (my own), but the loop-page.php and the page.php have defeated me so far.

    What I would like to do is the following:

    On the parent page, I want to show a bulleted list of its sub pages.

    No matter how I edit things, it doesn’t seem to work. I tried to include it on the page.php, but it lists the child pages either above the actual page, or below (before the comments), but not inside the content.
    If I add it to the loop-page.php, it seems to do nothing at all.
    I’m sorry, my php coding really sucks.
    On top of it, the live blog just went down, so I can’t get at the code I did use. (Argh!!)
    Will post it when I can, but if anyone knows a way, I’d much appreciate it.
    Ideally I don’t want to edit the page.php, but use the loop-page.php instead.

Viewing 1 replies (of 1 total)
  • I’ve figured it out. 🙂
    If you insert the following in your loop-page.php

    <?php
      $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
      if ($children) { ?>
      <ul id="mainNav">
        <div id="locationsNavHead">Categories</div>
      <?php echo $children; ?>
      </ul>
    <?php } ?>

    before edit_post_link — you get a nice bulleted list of the subpages of that particular page, without ever having to touch the page.php

    I hope this helps someone else. 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘List of sub pages on parent page’ is closed to new replies.
Skip to toolbar