WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Execute [subpages] on every page that contains subpages

[Resolved] Execute [subpages] on every page that contains subpages

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author webvitalii

    @webvitaly

    It is impossible to make with the plugin.

    I would recommend to modify theme files.
    You should check if current page has subpages and in that case you should show that subpage.

    Thanks!

    So, i have to modify theme code and it’s impossible to make a code call to the plugin from the theme page, right? (this could be a stupid question)

    Plugin Author webvitalii

    @webvitaly

    You should add to template something like this:

    <?php
    $children = get_pages('child_of='.$post->ID);
    if( count( $children ) != 0 ) {
    	echo do_shortcode('[subpages]');
    } else {
    	// no subpages
    }
    ?>

    That works perfectly!

    Thank you so much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Execute [subpages] on every page that contains subpages’ is closed to new replies.