It is very easy to use WordPress featured image as full-screen background image in WordPress. Let’s suppose you want to use your WordPress featured image as full-screen background image on your specific page e.g custom landing page.
You can use following code in your theme file. Just change normal body tag with the following tag.
<body <?php body_class(); ?> style="background: #6FBB72 url(<?php echo $src = the_post_thumbnail_url( '' ); ?> ) repeat 50% 0 fixed !important;">
Now create your new page in WordPress dashboard and use a large image as featured image.
That’s all. 🙂 Now you know how you can use Featured images as Full Screen Background Image in WordPress.
Leave a Reply