Skip to content

Instantly share code, notes, and snippets.

@theStreets93
Last active November 10, 2015 10:46
Show Gist options
  • Save theStreets93/37c4efaa7029d5fa2385 to your computer and use it in GitHub Desktop.
Save theStreets93/37c4efaa7029d5fa2385 to your computer and use it in GitHub Desktop.
Wordpress - thumbnail - if not set featured image get placeholder
<?php /* if no have thumbnail */
if ( has_post_thumbnail() ):
the_post_thumbnail('size', array('class' => 'yourClassForImage'));
else:
/* get your placeholder image */
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment