Every now and then, I need to display a list of all the child pages of a top level page in WordPress. This might be for a sub menu, or listing of some kind, for a page that we know the slug for, but that we don’t want to go to the effort of finding the ID for. I think this is a nicer solution in case the database is migrated, although name changes are probably going to affect it more I guess on reflection.

Anyways, the function I use is this…

$post is captured at the beginning of the function incase you call this half way through a post – therefore it’s not affected.

Simply call it like this

Image Credit: quas