0
I need to put the Wordpress thumbnail as background in a div
Currently has img even, using Loop::thumbnail()
0
I need to put the Wordpress thumbnail as background in a div
Currently has img even, using Loop::thumbnail()
0
You can insert the url of the thumbail into a style inside the div, this way every time you change the thumbnail it will be changed in the background of the div too:
<div style="background-image: url("<?php echo get_the_post_thumbnail_url(get_the_ID()) ?>");">
</div>
Remember to pass the post id as a function parameter get_the_post_thumbnail_url().
Browser other questions tagged wordpress background thumbnail
You are not signed in. Login or sign up in order to post.
It worked out! I had done something similar here too. Thanks!
– João Salves