<?php the_post_thumbnail( 'medium' ); ?>
<?php if( has_post_thumbnail() ): ?>
<?php the_post_thumbnail( 'medium' ); ?>
<?php else: ?>
<img src="<?php echo get_template_directory_uri()?>/images/noimg.jpg" alt="<?php the_title_attribute(); ?>">
<?php endif ; ?>