What are subpages and why would I use them?
Word-Press has a built-in subpage feature allowing you to organize pages in a parent-child-sibling tree and place them on the menu. What are sub-pages, why would I use them, and what plug-ins are available to use and enhance them?
Why use subpages?
The subpage feature should not be used to paginate a long page. If you simply have a long page, use the nextpage tag which paginates a long page or post. Please note that Thord thinks Pagination Is Evil and no one wants to incur the wrath of Thord! That’s not what I’m talking about.
The best use of subpages is to organize hierarchical content into a hierarchy or outline. We can already do this simply by using the HTML heading tags (h1, h2, h3, etc.) as is done in most items posted here at WPMU.org and in this post, but subpages add the additional abilities to place them on the menu, in a sidebar menu, and provide navigation between them.
Creating subpages and adding to the main menu
Before we can use any of the advanced subpage features, let’s see how to create subpages. When adding or editing a page, in the right hand-column, under the heading “Page Attributes”, select the Parent for the page, making the page we’re working on a subpage or “child” of “CV”. The other pages listed under “CV” are also subpages and are the “siblings” of our page.
Once a subpage has been created, it can be added to the menu by hand, or better yet use a plug-in to Automatically Add WordPress Submenu to Parent Menu for Pages, giving this result.
Using a widget to place a subpage menu in a sidebar
In the following example, I used the Subpages Extended plugin to create a subpage menu in the sidebar and then used the Dynamic Widgets plugin so that this menu would only display on the Parent page and its subpages.
Using a plugin for improved navigation on each subpage
When using the nextpage WordPress tag, the navigation inserted at the bottom of each paginated page simply lists the paginated pages as numbers (i.e. 1 2 3 4) with each page number linked appropriately. This works fine for breaking up a long page, but not when we want to organize the information into subpages to gain the benefits of the subpage feature and plugins. (See Pagination: How to Split a WordPress Post into Multiple Pages tutorial.)
I used the List Pages Shortcodes plug-in to place navigation at the top of each supage and the parent page.
This is the shortcode I used:
Here’s what it looks like on one of the subpages:
I chose to exclude a link to the subpage currently being displayed from these links. In this example “Exhibitions 2010 – 2012” is pageid 150 and is excluded in the shortcode.
On last thing: I used the Catch Ids plugin to make it easier to determine the pageid’s for my parent page and subpages.Tags: