Conditional Tags If Custom Post Parent & Child?

post_parent is a numerical value field in $post object. So you should check if there’s a valid number. Try this –

<?php if ( $post->post_parent > 0 ) { ?>
    the child single-artists.php
<?php } else { ?>
    the parent single-artists.php
<?php } ?>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)