I'm trying to build a template file for my custom post type that is different for the parent, child, and child's child post.
The best I've been able to find is the following code:
if( $post->post_parent !== 0 ) {
get_template_part('content', 'child');
} else {
get_template_part('content');
}
Only issue with this is that it only works for Parent > Child.
Is there any way to make this work for Parent > Child > Child?