Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.