Use WordPress Feature image as Background

This snippet allows you to get the WordPress feature image and use it as a background.
Style it using the css class feature-bg. Remember to put the code around your content in your WordPress Template files.

The code will dynamically take the feature image thumbnail if the current post has one.

[cc lang=”php”]ID ) ): ?>
ID ), ‘single-post-thumbnail’ ); ?>

Categories WordPress


I’ll be creating more content about starting and running WordPress plugin businesses. You can follow the journey by joining my mail list.

Leave a Comment