Setting Up an Index of Child Pages on Parent Pages in WordPress
With WordPress, you can easily create Child Pages (i.e. subpages) for a Page. (Keep in mind that we’re talking about “Pages” here, not “Posts.”) The problem, however, is that creating a Child Page really doesn’t do anything on the front end of your blog (i.e. the part the public sees). You cannot, for example, easily check a box or two and then display those Child Pages automatically on the Parent Page.
In this post, we’re going to go over a few solutions for correcting that – showing you how to get a list of Child Pages to appear both on a Parent Page and also in your sidebar.
Getting a List of Child Pages on a Parent Page
There are a few different plugins available that will allow you get a list of Child Pages.
1. Child Pages Shortcode
One of the easier and nicer looking plugins for listing Child Pages on a Parent Page is the Child Pages Shortcode.
Once this plugin is installed and activated, simply place the shortcode it gives you where you’d like your list of child pages to appear (e.g. at the bottom of the content on your Parent Page).
While there are a number of variables that you can enter into your shortcode to get different information or looks, the basic shortcode is pretty easy and looks like this:
If you have at least two Child Pages for the Parent Page, it will give you two excerpts (with featured images if you have them) side by side.
One very convenient variable you can put in is the width variable. This will allow you to, for example, list three child pages across the page by making each excerpt blog 33%. Inserting that variable would look like this:
And here’s the result of that.
2. List Pages Shortcode
The List Pages Shortcode plugin is another option for you. Out of the box, it will give you a more traditional text/link list of your Child Pages.
For example, inserting the shortcode [child-pages] will give you a simple list like the following:
This plugin also lets you enter more variables. For example, you can choose to return only the top level Child Pages if you like, or you can choose to return even Sub-child Pages.
Getting an excerpt to return is a little more complicated, and to be honest, I ran into problems getting it to work for me.
Getting a List of Child Pages in Your Sidebar
While getting links and excerpts to your Child Pages on the bottom of your Parent Page is nice, you might want something to appear in the sidebar as well (or even exclusively). In order to do that, you can use the Child Page Navigation plugin.
This plugin will let you put a widget into you sidebar area, and if a visitor is on a Parent Page (or one of the Child Pages), a list of the Child Pages will appear. If they are on any other page, the widget will disappear as if it doesn’t exist.
Here’s a look at how that appears.
And there you have it – a few options for taking advantage Child Pages and displaying them for your visitors.
Photo credit: Roland Lakis