To check if a page has any children/subpages, insert the following into your functions.php file,
[php]
/*—————————————–
Check if a page has any children / subpages
—————————————–*/
function has_children($post_id) {
$children = get_pages("child_of=$post_id");
if( count( $children ) != 0 ) { return true; } // Has Children
else { return false; } // No children
}
[/php]
then in your template call it as follows (within an if statement usually):
[php]has_children($post->ID)[/php]