query if page has not child
$args = array( ‘post_status’ => ‘publish’, ‘post_parent’ => $post_id ); $children = get_posts( $args ); if( count( $children ) > 0 ) { //has children } else { //does not have children } Docs: get_posts() This should also allow you to have access to the data of the children, should you need it. If you … Read more