Forums

Listing all pages including grandparent pages on subpages (4 posts)

  1. kidAlynch
    Member
    Posted 2 years ago #

    I am certain this has been done before but I am having trouble finding the solution. Please paste any links to helpful documentation or other forum posts on this topic.

    What I want is for each of my main navigation pages to list all subpages beneath (depth=0), but when visiting a subpage I would still like for the grandparent and parent pages to remain in the list. Currently I am using the code from the wp list pages documentation:

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

    The problem with this is that when you visit a subpage the parent pages disappear. See http://www.toledomuseum.org/wordpress/be-involved
    to see what I am talking about when you select a subpage.

    I know this is basic. I have searched high and low. If you have any wisdom on the topic it would be greatly appreciated. Thanks.

  2. kidAlynch
    Member
    Posted 2 years ago #

    This has to be very simple. anyone?

  3. exizt
    Member
    Posted 2 years ago #

    I am having trouble with exactly the same problem. Have you had any success with this?

    Thank you

  4. exizt
    Member
    Posted 2 years ago #

    I found my solution with the Fold Page List plugin (http://www.webspaceworks.com/resources/wordpress/30/). I used a line like this: <?php wswwpx_fold_page_list ('title_li=&depth=3'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.