Check how many ancestors the page has via get_post_ancestors
:
// grandchild pages will have two or more ancestors
if( 2 <= count( get_post_ancestors( $post->ID ) ) ){
echo 'grandchild page';
}
Check how many ancestors the page has via get_post_ancestors
:
// grandchild pages will have two or more ancestors
if( 2 <= count( get_post_ancestors( $post->ID ) ) ){
echo 'grandchild page';
}