I have a website (http://sfa.uconn.edu/) that displays left menu with a list of child pages on any parent page (and its children), like this:
However, I would like to hide this functionality from top level pages with no children, because it just displays the page title twice, like this:
Does anyone know a way to test if (1) the current page is top-level and (2) the page has no children.
get_ancestors( $page->ID, 'page' )
should return an emptyarray
if the page is at the top level.