Dynamic, Automatic Indices of Pages

The Trick, Said Quick

Use a plugin to display an index of content created as WordPress Pages; if you re-organize the order, add new content, the index is always up to date.

The Trick, In Intricate

WordPress Pages are ideal for organizing content in outline structure, rather than date-oriented format of Posts. This might be useful for book like content, where the index is a table of contents. Or maybe it is a series of events or course resources.

The Page Attributes settings allow you to manage the order in which they are displayed, and using existing Pages as parents allows for a hierarchical structure of subpages (and subpages of subpages).

The Page-List plugin provides a versatile way to display an index of pages, or a portion thereof, by simple use of shortcodes in your post (it’s a human usable front end for the WordPress code function wp_list_pages).

At it’s simplest level, using the shortcode [pagelist] anywhere in a editing screen will create a full sitemap of all Page content on your site. More handy is within a page structure, using something like [subpages] will list all Pages that are children of a current page and [siblings] list other Pages at the same level in the hierarchy. I often use [pagelist_ext] because it can use the featured images of the pages as icons and also include ane excerpt as well.

All of these shortcodes include more options you can use to control the output.

For one example of use, I used a Page Structure to organize a week of mini-lessons for the Ontario Extend Project Domain Camp.

The Domain Camp Page is the main entry, and includes sub-pages for each week:

A one level subpage structure for a series of activities under “Domain Camp”

The order of listing is not defined by date (later ones are below), but using the Page Attributes in each subpage.

Set the parent page to make this a subpage, and use numbers on the Order field to control list order

By making this Page have a parent of Domain Camp makes it a subpage. The Order values need not be sequential, so often I will leave gaps between to leave room for changes later (like I might use 1,5,10,15,20) or even 10,20,30,40 for a possibly complex page order).

Without assigning a Order value, pages will be listed in alphabetical order.

For the main index page of Domain Camp, in my editor i simply use [pagelist_ext image_width="180"] to generate this list every time the page loads:

How the plugin renders the index from the shortcode

The amount of excerpt listed for the subpage can be set by the limit_content parameter in the short tag, but also is better controlled by use of the more tag in editing the sub pages.

For each subpage, I put at the bottom the shortcode [siblings] to list all the other subpages so a reader can navigate to another unit quickly. This looks like on say the Week 2 page:

A navigation to other pages at the same level of the current one. The bold style indicates the current page in view.

The major advantage of this is I can start a site with maybe just one subpage (like in a course), and as I add more, all of these indices are always updated to reflect the current structure of the Pages on this site.

This plugin is rather powerful, especially as you explore the other options you can use; I have put it to use on many sites.

For a similar kind of trick to use with Posts, see the Display Posts Shortcode plugin. And if you are looking for an alternative way to order posts, pages try the Simple Custom Post Order plugin.

The Trick, Done Slick

The Trick, Give it a Kick

Tweet back a reply with an example you tried and/or how might you use this?

Featured dog trick image by Katrin B. from Pixabay