• Hi
    I need to create a page template for a child theme of Stargazer that lists child pages (of current page, if there is/are any) after the parent’s page content.
    Not really sure where would be best to begin, so I thought I’d try my luck here, in case one of you could suggest a good way of accomplishing this.

    (I do know of the shortcode plugins, but to keep the post editor clean for inexperienced users a page template would be a better option).

Viewing 1 replies (of 1 total)
  • Thread Starter thorirv

    (@thorirv)

    It’s funny how the brain only gets going after posting on the forum. So, to answer my question, this got me started:

    <!-- Show Child Pages of Current (if there are any) -->
    <?php
    	$children = wp_list_pages( 'title_li=&child_of='.$post->ID.'&echo=0' );
    	if ( $children) : ?>
    		<ul>
    			<?php echo $children; ?>
    		</ul>
    	<?php endif; ?>
    <!-- End Child Pages -->

    From here.
    Needless to say some way to go still, but a start..

Viewing 1 replies (of 1 total)
  • The topic ‘Page template that shows child pages’ is closed to new replies.