Skip to content

Instantly share code, notes, and snippets.

@jdcauley
Created July 16, 2014 18:51
Show Gist options
  • Save jdcauley/e37a29e3d9cd76ddbcc8 to your computer and use it in GitHub Desktop.
Save jdcauley/e37a29e3d9cd76ddbcc8 to your computer and use it in GitHub Desktop.
Featured Image with Empty State
<div class="blog-img">
<?php if (has_post_thumbnail()): ?>
<?php $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 5600,1000 ), false, '' ); ?>
<div class="blog-feature" style="background-image: url(<?php echo $src[0]; ?>);"></div>
<?php else: ?>
<div class="blog-feature-empty"></div>
<?php endif; ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment