List subpages of a parent page

I’m using the wp_list_pages function a lot for displaying parent pages in the main menu.

I usually only show the parent pages without children (on a homepage). In the function I use depth=1 to only sum up the top level pages:

wp_list_pages('title_li=&depth=1' );

When visiting a page i like to sum up the subpages of the parent page in a submenu. Sometimes (when using a submenu on a left sidebar) i like to show the parent page again on the top of the subitems. I created a function for this which you can put in your functions.php template file. This function is only created to list 1 level of subpages, no sub-sub is supported (yet) on the moment. Maybe I will update the function when I need it myself :)

Continue reading