I am creating a custom Wordpress theme for a site I'm developing and want to add a sub-navigation menu to the sidebar.
So how it will work, once you are on a particular page, if the page has "child" pages, it will post the parent page as a title and the child pages in an unordered list. So something like this:
<li>Child Page 1</li>
<li>Child Page 2</li>
<li>Child Page 3</li>
If a page doesn't have any child pages, I don't want it to show anything.
Can someone lend me a hand? I've found a couple of samples online but none that are exactly what I'm looking for.
P.S. I would prefer to not use a plugin to do this.