April 17, 2019
Works great if you’re using a sub-menu that shows related-level items when on a page.
function has_sibling() {
global $post;
if ( $post->post_parent ) {
$siblings = get_pages( 'child_of='.$post->post_parent );
if ( count($siblings) > 1 ) {
return true;
} else {
return false;
}
} else {
return false;
}
}