/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function list_sub_pages () { global $wp_query; $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>"; } echo '<ul>'; wp_list_pages("title_li=&child_of=$parent" ); echo '</ul>'; }