I believe you want something like the following:
<?php
if( has_post_thumbnail( $post->post_parent ) ) {
echo get_the_post_thumbnail( $post->post_parent );
}
?>
Calling the_post_thumbnail();
should return the current post thumbnail, whereas using get_the_post_thumbnail();
will allow you to specify the ID, using the parent ID in your case.
Function Reference for get_the_post_thumbnail()
Also, if you’re doing this outside of the loop, you’ll need the $post
global variable, as seen here.