Return to Snippet

Revision: 58012
at June 21, 2012 03:31 by sarahfrantz


Initial Code
<?php if($post->post_parent)
$children = wp_list_pages(‘title_li=&child_of=’.$post->post_parent.’&exclude=’.$post->ID.’&echo=0′); else
$children = wp_list_pages(‘title_li=&child_of=’.$post->ID.’&exclude=’.$post->ID.’&echo=0′);
if ($children) { ?>
<li>
<h5>
<?php
$parent_title = get_the_title($post->post_parent);
echo $parent_title;
?>
</h5>
<ul>
<?php echo $children; ?>
</ul>
</li>

<?php } } ?>

Initial URL


Initial Description
Based on code via Tammy Hart - slight modification to exclude current page.

Initial Title
List Pages in Sidebar, Exclude Current Page

Initial Tags


Initial Language
PHP