Using the_post_thumbnail() inside inline css
-
Hi, I want to call the the_post_thumbnail() feature image on specific page templates as a css div background. I am doing this inside my functions.php inside a child theme. I need to call a different background image inside a banner section of the page template for different pages.
My code is:
function venuebanner() { ?> <div id="banner-var" style="background: #333 url(<?php the_post_thumbnail();?> ) no-repeat center top;"> <div id="wrap" class="container"> <?php myvenue_navbar(); ?> </div> <!--id="wrap" class="container" --> </div> <!--banner --> <? }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Using the_post_thumbnail() inside inline css’ is closed to new replies.