Created
July 16, 2014 18:51
-
-
Save jdcauley/e37a29e3d9cd76ddbcc8 to your computer and use it in GitHub Desktop.
Featured Image with Empty State
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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