Sometimes I want a listing of the child pages to be embedded in the text of a page. This could be done manually but then maintenance of the site is a nightmare (unless it is a really static site!)
So adding the following code into the relevant page template for the WordPress site works a treat.
[php]
<?php
$children = wp_list_pages(‘title_li=&child_of=’.$post->ID.’&echo=0′);
if ($children) { ?>
<ul>
<?php echo $children; ?>
</ul>
<?php } ?>
[/php]
While it is not a rule, this related page listing is probably going to appear underneath any of the page text content, so look for the following in the page template and place the child page code below this line.
[php]
<?php the_content(); ?>
[/php]
[…] ColorWay theme By InkThemes.com and while I like the theme it was annoying me that when I used the wp_list_pages function to get a list of child pages (which I logged earlier this year), it kept adding the Home page to the list as if it were a child […]