Skip to content

Instantly share code, notes, and snippets.

@senlin
Created July 26, 2012 15:23
Show Gist options
  • Save senlin/3182678 to your computer and use it in GitHub Desktop.
Save senlin/3182678 to your computer and use it in GitHub Desktop.
List children of Page with excerpt
<?php
$pageChildren = get_pages('sort_column=menu_order&hierarchical=0&child_of='.$post->ID);
if ( $pageChildren ) {
foreach ( $pageChildren as $pageChild ) {
echo '<div class="page-excerpt-wrapper">';
echo '<h2>'. $pageChild->post_title.'</h2>';
if ($pageChild->post_excerpt){
echo '<p>'.$pageChild->post_excerpt.'</p>';
}
echo '</div>';
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment