Recent Child Pages

Recent Child Pages is a WordPress plugin that allows you to list the recently created child pages (also known as subpages) of a particular parent page. Basically, it is just like any other Recent Comments or Recent Posts plugin - except that this one is for child pages.

Demo

  • Check out the right sidebar of this page. You’ll see a list of the recent child pages of that page itself.

Features

  • Page hierarchy is ignored
    Even if you have nested your child pages into 3 or 4 levels, the plugin treats them all at the same level. This means that all your child pages will be ordered according to their post date without hierarchy, regardless of what level they are at. In the demo above, you’ll notice that three-level page nesting has been employed, but the Recent Articles section ignores the nesting.
  • Page independent
    You can choose the parent page whose child pages will be listed (this is optional though). This means that the template tag does not have to be on the parent page itself. You can even put it on a sidebar if you want to.
  • Configurable
    If you want to, you can choose what parent page to use, whether page dates are shown, whether a Recent Subpages title is shown, and most importantly, whether the plugin should list all recent child pages, or only those one level below it.
  • Simple installation and no file modifications required
    All primary options are handled by passing variables through the template tag. There is no need to modify plugin files (unless you want to)

Installation

  1. Download Recent Child Pages and extract the zip archive file.
  2. Upload recent-child-pages.php to your /wp-content/plugins/ directory.
  3. Activate the plugin in your blog’s Manage Plugins panel.
  4. Edit your theme templates according to the usage instructions below in your blog’s Theme Editor panel.

Usage

  1. Edit Templates:
    • Standard: In any of your templates (e.g. Main Index, Page Template), use the template tag recent_child_pages() wherever you want the list to appear.
    • Custom: Follow the same instructions as for Standard usage, but use a modified template tag following this structure: recent_child_pages ($parent_ID, $show_date, $show_title, $limit, $only_one_level).
      • $parent_ID: By default, no ID is set. The plugin will automatically list the recent subpages of the page on which the template tag has been placed. If you would like to override this behaviour, enter a page ID.
      • $show_date: By default, the date of each recent subpage is shown. To turn dates off, put 0.
      • $show_title: By default, the “Recent Subpages” title is not shown. If you do want to show it, put 1.
      • $limit: By default, the 10 most recent child pages are shown. If you want to show more or less, enter the number you want.
      • $only_one_level: By default, this is set to 0, i.e. all levels of child pages are considered. If you’d like the plugin to consider only the level of child pages right below the parent page, then set this to 1.
      • $excerpt_on: By default, excerpts are turned off. If you’d like to show an excerpt of user configurable length, then set this to 1.
      • $excerpt_length: By default, 40-word excerpts are created (if $excerpt_on is set to 1). If you want excerpts to be longer or shorter, enter the number you want.
      • $custom_title: By default, the title of the Recent Child Pages block is “Recent Subpages:” (if $show_title is set to 1). Change this as you see fit.
      • $pre_item_tag: By default, each item is pre-pended with a <li> tag. Change this as you see fit.
      • $post_item_tag: By default, each item is post-pended with a </li> tag. Change this as you see fit.
      • $pre_list_tag: By default, the entire list is pre-pended with a <ul> tag. Change this as you see fit.
      • $post_list_tag: By default, the entire list is post-pended with a </ul> tag. Change this as you see fit.
  2. Edit Stylesheet:
    • By default, the list of recent child pages comes unstyled. You can style it using your blog’s primary stylesheet though.
      • The entire block is wrapped with a “div” of class “recent_child_pages“.
      • By default, the list is an unordered list with no class or id - though this can be modified as you see fit.
      • By default, each item is a standard list item - though this can be modified as you see fit.
      • Dates are wrapped by a “span” of class “rcp_date“.
      • Excerpts are wrapped by a “span” of class “rcp_excerpt“.

Download

Changelog

  • v0.7: Allowed user-configurable titles, pre and post list tags, as well as pre and post list item tags. Added capability to draw excerpts of user configurable length.
  • v0.5: Plugin first released.

To-Do

  1. Allow user-configurable depth.
  2. Implement results cache.
  3. Allow user-configurable title.
  4. Allow user-configurable pre and post tags for each list item.

10 Comments

Leave a Reply