List subpages of current page
Copy this code and paste it in your HTML
function list_sub_pages () {
if( empty($wp_query->post->post_parent) ) { $parent = $wp_query->post->ID;
echo "<h3>".get_the_title
($parent)."</h3>";
} else {
$parent = $wp_query->post->post_parent;
echo "<h3><a href='".get_permalink
($parent)."'>".get_the_title
($parent)."</a></h3>";
}
wp_list_pages("title_li=&child_of=$parent" );
}
Report this snippet