January 24, 2018
Use the following function to determine if the current page you are on has any child pages.
Example uses: Sub-navigation, and page related widgets / action calls.
function has_children() { global $post; $children = get_pages( array( 'child_of' => $post->ID ) ); if( count( $children ) == 0 ) { return false; } else { return true; } }
Sourced here.