Make a child pages link list

September 16, 2013


function list_child_pages($post,$ul_class = "",$li_class = ""){
 $pages = get_pages('child_of='.$post->ID.'&sort_column=post_title');
 $count = 0;
 echo '<ul class="' . $ul_class . '">';
 foreach($pages as $page)
 { ?>
 <li class="<?php echo $li_class; ?>"><a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a></li>
 <?php
 }
 echo "</ul>";
 }

Tags: ,

Leave a Comment