Created
March 20, 2017 18:29
-
-
Save ingozoell/387a5bf533f1777e3bc2ad4e59977a7f to your computer and use it in GitHub Desktop.
Post thumbnail as background image inline
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 $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );?> | |
<div id="post" class"your-class" style="background-image: url('<?php echo $thumb['0'];?>')"> | |
<p>text demo</p> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment