Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
if ( have_posts() ) : while ( have_posts() ) : the_post();
if ( has_post_thumbnail() ) {
$feat_image_url = wp_get_attachment_url( get_post_thumbnail_id() );
echo '<div style="background-image:url('.$feat_image_url.');"></div>';
}
endwhile;
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment