Show subpages using shortcode

To show subpages you can use Pagelist plugin.

Or you can add this code to functions.php:

<?php
function wp_list_subpages(){
    global $post;
    $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
    if($children)
        return "<ul>".$subpages."</ul>";
}
add_shortcode('subpages', 'wp_list_subpages');
?>

And then you can use this shortcode [subpages] inside of your page content to show list of subpages.

Submit comment

Allowed HTML tags: <a href="http://google.com">google</a> <strong>bold</strong> <em>emphasized</em> <code>code</code> <blockquote>
quote
</blockquote>

Copy this code

and paste it here *