I need to put the Wordpress thumbnail as a background in a div
Currently with img same, using Loop :: thumbnail ()
I need to put the Wordpress thumbnail as a background in a div
Currently with img same, using Loop :: thumbnail ()
You can insert insert the thumbail url into a style inside the div, so every time you change the thumbnail it will change in the background of the div as well:
<div style="background-image: url("<?php echo get_the_post_thumbnail_url(get_the_ID()) ?>");">
</div>
Remember to pass the post id as a parameter to the get_the_post_thumbnail_url () function.