Forums

Page showing child pages (6 posts)

  1. lpe04
    Member
    Posted 3 years ago #

    Can someone please show me how I can get a page to show all subpages filed under it.

    Do I need to create a new template?

    Thanks!

  2. lpe04
    Member
    Posted 3 years ago #

    Ok, I've tried

    <?php
      if($post->post_parent)
      $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
      else
      $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
      if ($children) { ?>
      <ul>
      <?php echo $children; ?>
      </ul>
      <?php } ?>

    but it doesn't work because it comes after a widget. Any help?

  3. hazelbug
    Member
    Posted 3 years ago #

    There is a plug in that I found. I haven't used it so I don't know how good it is.
    http://wordpress.org/extend/plugins/ryans-suckerfish-wordpress-dropdown-menu/

  4. lpe04
    Member
    Posted 3 years ago #

    Thanks for your advice, I'm trying to display it in the content area (an unordered list), so I don't know if this will work.

    Take care!

  5. hazelbug
    Member
    Posted 3 years ago #

    oh - i thought you meant a drop down menu. I'm not sure about the coding for that. good luck

  6. moshu
    Member
    Posted 3 years ago #

    http://codex.wordpress.org/Template_Tags/wp_list_pages#List_Sub-Pages
    (note, it should be in the template, not in the content!)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags