W3 Mind Logo
Home » How to use featured image as background in WordPress

How to use featured image as background in WordPress


<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );?>
<div class"my-class" style="background-image: url('<?php echo $thumb['0'];?>')">
<h1>Dummy Title</h1>
</div>

About Author
Picture of W3Mind

W3Mind

W3Mind focuses on Blogging, Make Money Online, SEO, Business Blogging, Social Media, WordPress, Internet Tools, Web Design and Development.
Give it a Share
Facebook
Twitter
LinkedIn
You May Also Like
How to
START A
BLOG
(step by step)
Load WordPress Sites in as fast as 37ms!