WordPress blog archive: featured image or static default image
<div class="list-article-thumb"> | |
<a href="<?php echo esc_url( get_permalink() ); ?>"> | |
<?php | |
if ( has_post_thumbnail( ) ) { | |
the_post_thumbnail(); | |
} else { | |
echo '<img alt="" src="'. get_template_directory_uri() . '/images/placeholder.png' .'">'; | |
} | |
?> | |
</a> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment