
Showing excerpts from Child Pages on a Parent Page would seem to be incredibly useful for all sorts of users, not the least of which are businesses trying to use WordPress for their entire company websites (i.e. not just for blogging).
Although Pages don’t have excerpts out of the box, adding a plugin and configuring a few things will let you show excerpts from Child Pages on a Parent Page.
Three Steps
Essentially, there are three things that need to be done.
- Install a Page Excerpts plugin.
- Create a customized page template to show the excerpts on the Parent Page.
- Assign your template to your Parent Page.
Tutorial: Hypothetical Web Design Company
In order to run through this process, we’ll pretend we’re a simple web design company that wants to have a main “Web Packages” parent page, and then child pages for each type of design package it offers (Standard, Pro, & Premium).
Now, granted, if you were a web design company, you’d probably want better graphics than this, but this is just a simple example stripped down to the bone.
Let’s go ahead and take a look at the finished page to see what we’re trying to do.
Featured Plugin - WordPress Facebook Plugin
Page Excerpts Plugin
Out of the box, WordPress doesn’t provide excerpts for Pages, and so the first thing you’ll need to do is install a page excerpts plugin. It seems there are a few of them out there. The first one I tried worked, and so I went with that. (As this isn’t a plugin post, I didn’t try the others. As long as it works, you’re good to go.)
Create a Custom Page Template
You will need to create a new template for you Parent Page. In order to do this, follow the instructions below:
Step I: Create a New Template File
On your server, find your theme’s folder (wp-content/themes/your-theme).
Create a new file and name it something unique and appropriate (e.g. page-excerpt.php). Remember to end it with the .php extension.
After that, find the file named page.php. Open that, copy the contents, and then go back to the file you just created (page-excerpt.php), and paste those contents into your new file.
Now, at the VERY TOP of your new file (i.e. BEFORE the content you just added into it), put the following:
<?php /* Template Name: Page Excerpt */ ?>
It should look something like this:
Featured Plugin - WordPress Infinite SEO Plugin
Step II: Insert Code to Pull in the Excerpts
This part might get a little tricky depending on your theme.
Essentially, you want to insert the following code after your loop (the code that displays your content):
<?php
$pageChildren = get_pages('sort_column=menu_order&hierarchical=0&child_of='.$post->ID);
if ( $pageChildren ) {
foreach ( $pageChildren as $pageChild ) {
echo '<p><a href="' . get_permalink($pageChild->ID) . '">'. $pageChild->post_title.'</a></p>';
if (!empty($pageChild->post_excerpt)){
echo '<p>' . $pageChild->post_excerpt.'</p> ';
}
}
}
?>
Possible Problems
When I did this with WordPress’ Twenty Ten theme, however, it didn’t work. And so it might not work with your theme either.
The solution was to remove the code that the Twenty Ten theme was using to pull in the content for the page and replace that with a different piece of code for the loop. (Or, if you want ONLY excerpts on the page, you could substitute the code above for the loop code.)
If you run into problems, try this …
Search for your “content div.” It will probably look like this (although it may have a few other properties to it as well).
<div id="content">
And then go down and search for the spot where that div closes off. It may just say </div> or it may say something like …
</div><!-- #content -->
Delete everything in between the opening div and the closing div. And then replace it with this …
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php the_content(__('Read more'));?>
<?php endwhile; else: ?>
<?php endif; ?>
<?php
$pageChildren = get_pages('sort_column=menu_order&hierarchical=0&child_of='.$post->ID);
if ( $pageChildren ) {
foreach ( $pageChildren as $pageChild ) {
echo '<p><a href="' . get_permalink($pageChild->ID) . '">'. $pageChild->post_title.'</a></p>';
if (!empty($pageChild->post_excerpt)){
echo '<p>' . $pageChild->post_excerpt.'</p> ';
}
}
}
?>
It should look something like this …

Save your file, and you’re done with the template.
Featured Plugin - WordPress Q&A Site Plugin
Creating Your Parent Page
When you create your Parent page (in this case “Web Packages”), you should now see an option on the right-hand side to select your new template: Page Excerpt.
If you choose to write anything on this page, what you write will appear on top of the excerpts for the child pages. Because of this, you might even consider putting a headline for the child excerpts that will come after. To do this, put your headline at the BOTTOM of this parent page.
Creating Child Pages
In order to create a child page, you simply select the parent page on the right-hand side of the edit screen. You also have the ability to control the order of your child pages there.
As mentioned above, you can control the order of your child pages on the edit screen. But you can also control the order through the Quick Edit function by going to Pages > All Pages > (hover over title) Quick Edit.
The order of your pages will determine the order of your excerpts. By default, all pages are set to “0” for the order. And so if you set another page to “1,” the “0” page will still show up before it because its number is still lower.
Featured Plugin - WordPress Google Maps Plugin
Creating the Excerpt
The excerpt plugin doesn’t automatically take excerpts from your Pages, but it does give you an Excerpts Box on your editing screen that you can then fill in.
Once uploaded and activated, when you are on the editing screen for your Page, you may have to activate the Excerpts Box through your “Screen Options” at the top of the page in the right-hand corner.
Once that is done, you should see an Excerpts Box under your main writing screen where you can manually insert excerpts.
Featured Plugin - WordPress Appointments Plugin
The Finished Product
Let’s take one more look at the finished product, this time with a few notes:
WordPress as a CMS
For some, this solution might be a big step toward making WordPress truly work as more a fully-fledged CMS. I can’t tell you how many times I’ve heard people say they’ve built WordPress sites without ever using one single “Post” page.
If you use Pages extensively, then sooner or later you are bound to run across situations where using Child Pages, and then their excerpts, of course, would be a logical fit for your needs. While it would be nice to have all this functionality built in, this solution should work for you in the meantime.
Featured Plugin - WordPress Newsletter Plugin
Photo: CMS : content management system concept. Isolated on white from BigStock








Thanks for this. Great insight, have tried it and it worked brilliantly as stated.
However I was wondering if we can use this plugin to create a new main category page and pull excerpts from individual posts (and thumbnails) from under that category.
Any ideas?
Hi – I’m not sure exactly what you’re getting at. When you say “posts,” do you mean actual blog posts or “pages?”
I meant posts. I need to redesign my main category pages [e.g. http://halalmedia.net/category/halal-consumerism/ to include say 5 posts from different sub-categories residing under it.
I was wondering if these codes can be modified to show post excerpts and thumbnails under a new post template. Then I realised its not built for posts, sorry. Any resource you can recommend for me to study in order to redesign a new main category page as above?
Thanks in advance.
Great article. To save time how about this gem of a page-list plug-in.
I’ve tested this out moderately, and can give it a thumbs up. Options galore and current!
Author Page: http://web-profile.com.ua/wordpress/plugins/page-list/
On WordPress.org: http://wordpress.org/extend/plugins/page-list/
Joe – That looks interesting. Thanks.
I just did something very similar for an insurance company. Allowing them to display a variety of different insurance options under 4 or 5 different header pages. It provides a much better way to create menus of pages that have child pages themselves. Great article!
Oh also, just wanted to mention that if your comfortable with the process, which you most likely are since this tutorial requires editing page template files. You can also add the following code to your function.php in order to provide excerpts for pages without having to install a plugin.
// add excerpts to pages
function add_page_excerpt_meta_box() {
add_meta_box( 'postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'page', 'normal', 'core' );
}
add_action( 'admin_menu', 'add_page_excerpt_meta_box' );
Means one less plugin for you to deal with ;)
Thanks, Matthew.
There is an easier way still. And since you had a previous plugin about adding categories and tags to pages this plugin solves all of those issues. http://wordpress.org/extend/plugins/ninja-page-categories-and-tags/
Thanks, James.
We just wrote up a post about this with some simple code you can use in your template file: http://wpgarage.com/code-snippets/how-to-list-subpages-with-title-excerpt-in-wordpress/