list child pages

<?php

$children = get_pages(‘child_of=’.$post->ID.’&parent=’.$post->ID);
if( count( $children ) != 0 ) {
?>
<ul>
<?php
foreach ($children as $pagg) {
$option .= ‘<li>’;
$option .= ‘<a href=”‘.get_page_link($pagg->ID).'”>’;
$option .= $pagg->post_title;
$option .= ‘</a></li>’;
}
echo $option;
?>
</ul>
<?php
}
?>

<?php $children = get_pages(‘child_of=’.$post->ID.’&parent=’.$post->ID); if( count( $children ) != 0 ) {  ?> <ul>                    <?php foreach ($children as $pagg) { $option .= ‘<li>’; $option .= ‘<a href=”‘.get_page_link($pagg->ID).'”>’; $option .= $pagg->post_title; $option .= ‘</a></li>’; } echo $option; ?>                    </ul>                    <?php } ?>

Leave a Reply

Your email address will not be published.