Display current page sub pages

Have you ever tried in WordPress, to list only the sub pages of the current parent page and hide the sub pages of the other parent pages? Adding this wordpress code snippet to your page.php will display the current pages sub/child pages in a list.



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

Leave a comment