thumbnail as background image with fallback
-
I am using this code to use my thumbnail as a background of a div. can someone help me write this so that if there is no thumbnail, to serve an static image?
<div style=”background: url(<?php the_post_thumbnail_url(‘custom’); ?> ); background-size:cover; background-position:cover;”>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘thumbnail as background image with fallback’ is closed to new replies.