WordPress child page menu
Here’s a nice and neat code snippet - making use of the template and conditional tags to output unordered list items for all child pages under the current page - with links - and just the thing to stick in a theme’s sidebar.
Best used in conjunction with is_page, of course, so…
<?php
if(is_page()){
$parent = ($post->post_parent == 0)? $post->ID : $post->post_parent;
wp_list_pages(’child_of=’.$parent.’&title_li=’);
}
?>










