Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 1.0   Updated Friday, February 20th, 2009 at 7:19pm

List Subpages Plugin for WordPress

This WordPress plugin generates a list of subpages for the page being viewed. You can use this plugin by inserting the trigger text in your page (where you want the list to appear), or by calling the function directly from your template file. One key feature of this plugin is that it can used outside the loop, which means you can display a list of subpages of the current page in your header, sidebar, or anywhere else. There are also several options available. You can change the sort method, exclude pages, adjust the page depth, show the date, and more.

Download

  If you have found this page useful, please consider donating. Thanks!

Installation

  • Download the above file
  • Rename dd-list-subpages.txt from .txt to .php and upload it to your plugins directory
  • Activate the plugin from the WordPress admin panel
  • Configure the options under the admin panel: Options – DDListSubpages

Change Log

  • 04-06-07 Version 1.0 – First release.

Usage

To display the list of subpages on your page, just add the trigger text to your page:

<!-- ddlsp -->

(If you are using the visual editor in WordPress, you may have to temporarily disable it to add in the trigger text)

You can also call the function directly from a template file with the following command:

<?php echo ddlsp_generate(); ?>

If you use this method, it does not have to be in your loop, which means you can display the list of subpages anywhere you like in your theme.

Whichever method you use, just remember that it only generates the list when viewing an actual WordPress page which has subpages.

Options

Here are the options available for this plugin under the WordPress admin panel. The options page also includes a ‘load defaults’ button.

Before List

This text is added before the list of pages.

After List

This text is added after the list of pages.

Sort Column

You can choose to sort the list by page title, menu order, page date, page modified date, page ID, page author, or page name (slug).

Sort Order

This lets you choose between an ascending or descending sort.

Excluded Items

This is a comma-separated list of page IDs you want to exclude from the list.

Included Items

This is a comma-separated list of page IDs you want to include. If you use this feature, only pages manually specified will be listed.

Page Depth

This is the depth of subpages that will be shown. The default is 1, and 0 means no limit.

Show Date

If enabled, the date will be shown after each page.

Date Format

If showing the date, this is the PHP date format that will be used.

List Title

This is an optional header for the list of pages.

Pages: « 9 [8] 7 6 5 4 3 2 1 » Show All

  1. Hi, I just wanted to thank you. A few of your plugins have been EXACTLY what I was looking for. This plug in especially. Thank you VERY much, and keep up the good work.

  2. Anyone know where to put the code in answer 105? I really need this.

    Thanks in advance.

  3. If you would like to display a table of thumbnails for the child page, you might look into this plugin –

    http://wordpress.org/extend/plugins/autonav

  4. Great stuff, been using it for a while now. One thing: I’ve customized my version to add the sort option “menu_order,post_title“: the default setting for wp_list_pages, I think, and one which makes a lot of sense. This could be a useful addition to a new version.

  5. 116
    Chris

    Great plugin, seem to have problems getting it to work with permalinks – is there an error?

  6. it’s GREAT !!!

    Thanksss !!!!

  7. 114
    Ataraxy

    “The only suggestion I have is to have it show on the subpage as well as the page that has child pages.”

    I agree with this. I came across this plugin and it does nearly everything I was looking for, except that. Now I’m trying to figure out how to modify it to do that.

    Thanks for the plugin!

  8. 113
    vanni

    Hi. I’m a WP newbie, I am looking for a way to have sub-pages that are connected to a specific page, and i think this plugin allows this. I want to be able to display the links of the sub-pages in the left-hand column and keep them all visible as i visit each of the sub-pages. For eg. see this page at this WP site:
    http://www.joyent.com/products/publiccloud/

    Can i expect your plug-in to accomplish this?

  9. 112
    Jan

    This is a fantastic little plugin. The only suggestion I have is to have it show on the subpage as well as the page that has child pages.

  10. Thank you for making available a superb plugin that is easy to install and very functional in getting the job done. Much appreciated.

  11. Currently there is no support for displaying anything but the links to the pages. I will keep those ideas in mind though.

    I do get a lot of requests for features on all my scripts, and unfortunately I am not able to implement everything.

  12. 109
    Jessy

    Is there a possibility to display one of the custum fields in each list item after the link?

    something like:

    
    <ul>
    <li><a href="">page1</a> - value custom field of page 1
    <li><a href="">page2</a> - value custom field of page 2
    <li><a href="">page2</a> - value custom field of page 3
    </ul>
    

  13. 108
    Sebastian Cruz

    Hi, great plugin! is there a way to insert thumbnails in the list of the subpages?? thanks!

  14. This plugin has been tested, and works, in the latest release of WordPress – 2.8

    A few comments below mentioned displaying the sub-list during other events, but the purpose of the plugin is simply do display the child pages of the currently viewed page only. I will consider ideas for future updates though.

  15. hi nice article list great work and thanks for u sear this with us

Pages: « 9 [8] 7 6 5 4 3 2 1 » Show All

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.