Including the parent page in a list of subpages
-
Currently, I am trying to get the link for the parent page to show in a list of its children.
I am using this code:
<?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 } ?>
Which, works perfect. However, I want the parent page to show up in the ul as well. However, I DO NOT want an visual hierarchy. To be more precise this is how I wish the pages to display:
Parent Page
Child Page
Child Page
Child Page
Child PageAs opposed to:
Parent Page
-Child Page
-Child Page
-Child Page
-Child PageCan anyone help me out? Thanks.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Including the parent page in a list of subpages’ is closed to new replies.