If you find yourself working on a WordPress theme and come to the conclusion that you want to only show a WordPress page’s subpages ( a very CMS type of thing to do ) here is a little code that I wanted to share with you:
<?php
$children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
if ($children) { ?>
<ul>
<?php echo $children; ?>
</ul>
<?php } ?>



Thanks for that tip!
June 4th, 2008 at 2:42 am
Thank you! A much better solution that the List Subpages widget.
August 28th, 2008 at 4:11 pm
Thank you. but i still didnt understand how i put php code in my subpage
September 27th, 2008 at 6:43 am
Thanks JTk. It’s so much better to do this without using a plugin.
Cheers!
January 27th, 2009 at 10:51 am
Thank a lot! I was already trying to analyze complex sub-page widgets but all I wanted was a simple template with this fucntion. Your code is extremely simple but likewise functional.
September 9th, 2009 at 11:59 am
Thank you so much! That is exactly what I have been looking for. Every previous example I found insisted on listing the whole tree, instead of just the child pages. Thank you!
November 7th, 2009 at 4:35 pm