Justin Tadlock

List Subpages With Descriptions: WordPress Plugin

This is my very first WordPress plugin! It’s a very simple plugin, and I made it mainly for use on my blog.

The function of this plugin is to list a WordPress Page’s subpages in an unordered list with a description of each one. Here’s an example of what it might look like:

  • Link to subpage This is the description of the subpage.
  • Link to subpage This is the description of the subpage.

How to use this plugin

The instructions for using the plugin are now located in a file named readme.html within the plugin folder.

This is fairly straightforward. When you write a subpage (child page), you assign a Key in the Custom Field of Write Page to “description.” You assign that Key (description) a Value of whatever you want — describe the Page.

In the parent Page, you call the PHP function list_subpages_with_descriptions(), and it will list all subpages for that Page and their descriptions that you gave them.

Why I made this plugin

The reason I made this plugin was because I was getting tired of hand-coding every subpage and it’s description. I couldn’t find any other plugins that provided me with a way to list the description with them. So, the “List Subpages With Descriptions Plugin” was born. You can see a slightly modified version of it in action on my Writing page. The listing is the same.

Plugin Information

Since this is my first plugin, it is simple. Something similar has probably been done before, and the programmers have moved on to bigger and better things. This works great for my blog. It should be useful if you have lots of subpages. There’s only one line of code you have to implement.

I’m still a newbie at this, so feel free to voice your concerns and/or praises. Feel free to do whatever you like with the code, or help me make it more flexible. Leave a comment telling me how it works or if you have any problems or whatever.

Please don’t use the comments or my contact page to ask support questions. Use my support forums at Theme Hybrid, which is where I handle all support questions for my WordPress projects. Feel free to report any bugs you come across though.