Display Title and Excerpt of Sub-Pages
-
I am trying to get a code working that will display the title and excerpt from one parent page. So far I’ve got the titles to display Every Page from another post I found. Here’s what I’ve got:
<?php $pageChildren = get_pages('sort_column=menu_order&hierarchical=0&child_of='.$post->ID); if ( $pageChildren ) { foreach ( $pageChildren as $pageChild ) { echo 'And the title is: '. $pageChild->post_title.' '; if ($pageChild->post_excerpt){ echo 'And the excerpt is: '.$pageChild->post_excerpt.' '; if (!empty($pageChild->post_excerpt)){ echo '<a href="' . get_permalink($pageChild->ID) . '">' . $pageChild->post_excerpt.'</a> '; } } } } ?>
I need it to display all the posts under the page “how-to” or id “390”.
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Display Title and Excerpt of Sub-Pages’ is closed to new replies.