Skip to content

Instantly share code, notes, and snippets.

@jasoncarrigan2
Created July 31, 2013 16:10
Show Gist options
  • Save jasoncarrigan2/6123432 to your computer and use it in GitHub Desktop.
Save jasoncarrigan2/6123432 to your computer and use it in GitHub Desktop.
<div class="span5 cf-image">
<?php
if(has_post_thumbnail()){
$thumbnail = get_the_post_thumbnail( $post->ID, array( 300, 300 ) );
} else {
$thumbnail = '<img width="300" height="300" title="no image" alt="no image" class="cf-no-image wp-post-image" src="' . $field_image . '">';
}
?>
<a href="<?php the_permalink(); ?>" ><?php echo $thumbnail; ?></a>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment