Show subpages using shortcode

To show subpages you can use Pagelist plugin.

Or you can add this code to functions.php:

function wp_list_subpages(){
    global $post;
    $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
        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="">google</a> <strong>bold</strong> <em>emphasized</em> <code>code</code> <blockquote>