Last active
January 1, 2016 17:47
-
-
Save SimonPadbury/b48aa4c4e64e2b364561 to your computer and use it in GitHub Desktop.
WordPress: Using featured images (thumbnails) as hero backgrounds (1 of 2).
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
<?php $hero = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' ); ?> | |
<div class="hero-background-image" style="background: url('<?php echo $hero['0'];?>') center top no-repeat;"> | |
<!-- Put your loop <header> in here. --> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment