SB Child List

This plugin lets you turn WordPress into a proper easily navigable CMS. Having a site made up mostly of pages in the form of a tree (an information site for example) was always a pain until I wrote this to help me out. I have had lots of feedback about it over the last few months and more and more people are finding ways they can use it to improve the navigation and usability of their sites

I wanted to show some sort of hierarchy in the pages inside WordPress. I decided to call one of my pages “articles” and have my articles use it as their parent.

Logically you would expect to see a list of the child pages on the articles page along with a pretty picture and some intro text. This doesn’t seem possible natively with WordPress so I decided to make it happen.


Adding the hook [ sb_child_list ] to any post or page will by default show an unordered list showing the children and links to them. If you prefer to style it yourself then don’t worry because you can do that too using the templating system on the settings page.

There is also add another tag, [ sb_parent ], that allows you to provide a back to parent link from any child. This enables you (in the articles example) to add a “click here to read more on this subject” link. It is also template based so it can say anything or look however you see fit

Category Listings

You can also use this shortcode: [ sb_cat_list category=CatName ] which does what it says on the tin, simply give it a category name and it will show the posts in that category for you with optional ‘limit’ argument

The plugin creates a widget for use also. This works if there is a sub page present. Much like a sub pages widget or similar.

I have added a shortcode for sibling navigation. You can use [ sb_sibling_next ] and [ sb_sibling_prev ] to show links to next and previous pages ordered by menu order followed by post title order. Handy indeed!


There is a simple templating sytstem to allow multiple templates for [ sb_child_list ] and [ sb_cat_list ] with the argument ‘template’ ([ sb_child_list template=”2″ ]). Also added excerpt support and support for the SB Uploader Plugin custom fields (custom field called post_image will show if necessary).


[ sb_child_list ] <-- Arguments allowed are: 'template', 'nest_level' and 'order'
[ sb_parent ] [ sb_grandparent ] [ sb_cat_list ] [ sb_sibling_next ] [ sb_sibling_prev ]

Example Site

I wrote this plugin so that I could display articles in a hierarchy on my boat site (Still in development). See examples of how I am using it at on the articles page. I have updated the CSS to fit it in with the rest of the site.



Latest version is in the WordPress Plugin Directory here:

Download an old archive version here (V1.0):


Shortcodes in this post have had spaces added before and after so they show and aren’t turned into lists of posts by WordPress. A consequence of using the same plugin on the site you are advertising :)



  1. paolo says:

    Hi Sean

    How can I add a class to the li?
    I want to style the li, not just the link.


    • Sean says:

      I will add this functionality to the next version.


      • Toon says:

        If you add that functionality, could you then add a different class to the of the current page. That way we can style (or ‘display:none’) the link for the current page. Although I think it is strange to have a link to the same page as where you ar at.

        Or, better yet, the possibility in the widget settings to leave out the current page (e.g. ”Show current page?: Yes | No”)

  2. RIchard says:

    HI love the plugin thanks,

    Is there away of highlighting in the child list widget the parent article to separate it from the children?


    • Sean says:

      Hey Richard, you can use [sb_parent] I think but not sure if I have written a way to allow you to identify the parent page in the normal list. Thanks for the feedback thought. Will look to change that for you for the next version.


  3. Duc says:

    Hi Sean

    Thanks for the plug-in, I have been looking for such a solution for ages.

    However I can’t seem to use it and I don’t understand why. I added the line [ sb_child_list ] in my wordpress page editor and there was no menu trees displayed at all. The line [ sb_child_list ] appeared as text in my page on the browser instead.

    I don’t know what I should do more or what I did wrong. Can you explain to me the process of using your plug-in again? Thanks very much.

    • Sean says:

      Hi Duc,

      The only way that the shortcode would show would be if the plugin was disabled or if it was spelt properly. Remove the spaces too, shortcodes don’t work like that.


  4. madison says:

    Hey Sean,
    How does order work? Tried
    [ sb_child_list order=”ASC”] and get nothing. Without order in shortcode, the list is fine, just not sorted. Looking for a way to sort the results alphabetically. Any help much appreciated.

  5. Hi Sean,

    I’m trying to get the nav bar to remain highlighted with the relevant selection when I go two levels deep into the nav. It works for me when I go one level deep, but not 2. I see that this works on your boat site, ( For example, this page still shows “About” as the selected menu option on your site: ) so I’m wondering what I am doing wrong. Please help! Thanks

    • Sean says:

      Hi Brandon,

      When you go a couple of levels down you should see an ancestor or parent class appear so you can hook into that. Maybe that works for you?

      Let me know


  6. Tal says:

    Hi Sean,

    Can i have the child list pages with thumbnail of the feature image and excerpt?


  7. Robert says:

    Hi Sean,
    Great plugin! I needed it to work with tags, so I made 4 little changes to the plugin – adding a sb_tag_list short code – and mine now works with tags as if they were categories. It would be a great feature to add to the next update. If you want to see my code, email me.
    Thanks, Robert

  8. Pete says:

    Hi Sean!

    Your plugin seems pretty nice! But how can I get a excerpt and a picture into this list?


    • Sean says:

      Hi Pete,

      I just checked the code. You can use [post_image] and [post_image2] as custom fields whereby you provide the URL or you can use [post_thumb] or [post_thumb_url] to get the post/page featured image for the list.


  9. Ben Brundell says:

    Hello and thanks so much for this plugin! I don’t understand why people think the built-in functionality in WordPress is fine for CMS use. One feature request: would it be possible to amend the shortcodes to allow passing of an image size to the thumbnail? This would allow people to take advantage of the thumbnail re-sizing for different menu systems.



    • Sean says:

      Thanks Ben.. you asked.. you got. Now you can add thumb_size into the shortcode arguments for any of the two main shortcodes and it will reflect the size you asked for on [post_thumb]. Let me know if this works for you on the latest version (3.6)


      • Ben Brundell says:

        Hi Shaun and thanks so much for the quick response! I’ve had chance to try it but am unsure of the syntax. I’ve tried [post_thumb thumb_size=”medium”] with and without quotes. Should I be using a pure px size?


        • Ben Brundell says:

          Sean: I apologise for naming you Shaun in the last comment! Sorry.

        • Joshua says:

          Hi Ben,

          I’m not sure if you’ve got your answer but what Sean means is that you can add thumb_size as a parameter to the [ sb_child_list ] shortcode. The value of the parameter, I assume, matches the WordPress keywords for the different image sizes (thumbnail, medium, large, full).

          Using v4.0 of the plugin, this is what works for me: [ sb_child_list thumb_size=’thumbnail’ ]

  10. Lili says:

    Hi Sean, I am still having trouble with the ordering. Just trying to order by title. The following is not working:
    [sb_child_list order="post_title"]
    See here:
    Please help. I use your plugin on 3 different sites, and ordering is really important.

  11. Lili says:

    NEVER MIND :-) Found the answer upstream (orderby=”title” order=”asc”)

  12. Paul says:

    I’m getting Warnings displayed on pages about mysql_real_escape_string function calls (lines 219 and 220). Looks like it expects 2 parameters, but it only gets the string to escape. I’m not seeing this issue on all hosts, so it could be related to specific php and MySQL versions.

    Any ideas?

    • Sean Barton says:

      It’s related to the PHP version I believe and not MySQL. You’ll see it a lot in the future as the function it’s throwing an error on is extremely popular. If you set your error_reporting value on the server to E_ERROR which will only show fatal errors you will shield yourself from this sort of thing for a while.


  13. Ben Brundell says:

    Hello Sean: something unusual here! I’m using your wonderful plugin on my site and it works great. When I try to add the same shortcode to the Home Page, the plugin fails producing no output at all.

    I’ve installed Autonav (which does work on that page), but would prefer yours.

    I tried adding the parent_id argument. I know this in itself does work on the home page (I can output a list of children of another page). When I add the ID of home it fails, so I went through the DB and used an ID of “0” which doesn’t work, either!

    So…not sure whether it’s me or not but wonder whether you’ve seen this before?

    Best wishes


  14. Hi, Sean,

    I would like to show only the first level of sub-pages, not the children of children sub-pages. Possible?

    • Sean Barton says:

      Hi Andrea,

      Yes it should be possible. Simply select the level in the settings to 1. It will only then present a single level of child links

      • Thank you, Sean! Somehow I missed that… too many hours at the computer, no doubt! I also discovered I can do it on a page-by-page basis using nest_level=1. Perfect! This is a great plugin for those top-level pages that are clickable, but contain only introductory information. With the SB Child List shortcode added, the page becomes much more valuable and user friendly because of the added navigation the list provides.

  15. Simon says:

    Hi Sean, wonderful plugin – I’m using it on a lot of my site. Is there any way of excluding grandchildren / just going 1 level deep?

Trackbacks /

  1. Demenagement Martin inc

Leave a Reply