Skip to content

Instantly share code, notes, and snippets.

@joviczarko
Created September 21, 2016 07:03
Show Gist options
  • Save joviczarko/4d9246d69a8a4c6df0fcee7db7e16300 to your computer and use it in GitHub Desktop.
Save joviczarko/4d9246d69a8a4c6df0fcee7db7e16300 to your computer and use it in GitHub Desktop.
Right way of calling the featured image on WordPress archive page
<?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail(); ?>
</a>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment