We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
We've now added the ability to get a featured image as a url.
function featuredURL($size){ $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), $size ); $url = $thumb['0']; echo $url; }
This function can be found in inc/thumbnails.php
inc/thumbnails.php
To use this function, simply call featuredURL($size) in your theme. Be sure to replace $size with the thumbnail size you want WordPress to return.
featuredURL($size)
$size
Example:
<div class="hero" style="background: url(<?php featuredURL('hero');?> center center no-repeat;"> <h1>Hero!</h1> </div>