Following on from previous question but needs to be more specific so thought a new topic would be best…
Conditional tag for custom post parent and children on their corresponding single.php, currently i have the following..
<?php if ( is_home() || is_page( 'overview' ) || is_page( 'about' ) ) : ?>
Home Page
<?php elseif ( 'artists' == get_post_type() ): ?>
artist parent
<?php elseif ( $post->post_parent > 0 ): ?>
artist child
<?php else : ?>
empty other pages etc
<?php endif; ?>
The issue being the parent shows up on all the single-artists.php pages.
I need to specifically target the parent single and the child single, is it possible as i donât think it is…?
Thank you.
I guess that you should change the order to first check if there is any parent: