WordPress

How to make your WordPress Featured Media a DIV background

Here is a quick snippet that makes your Featured Media a background for a DIV.

<div class="DIV NAME" style="background:url('<?php
//Get the Thumbnail URL
$src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), false, '' );
echo $src[0];
?>')!important;">