A Wordpress site about WordPress sites…
phone:   229.798.4330
skype:   doc5.com
The personal blog of a WordPress developer who is ready and available to develop your WordPress Blog.

Custom WordPress Theme Design

Show only SubPages in WordPress

June 3rd, 2008 . by JTk

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 } ?>

Join the Discussion - Post your comment  3 Responses to “Show only SubPages in WordPress”

  1. Susan Says:

    Thanks for that tip!

  2. Ammon Says:

    Thank you! A much better solution that the List Subpages widget.

  3. rado Says:

    Thank you. but i still didnt understand how i put php code in my subpage :(

Join the Discussion - Post your comment Leave a Reply