// replace this selector with your hero image .templatecontent's parent
$("body.default .section-hero .slider").each(function() {
var img = $(this).find(".templatecontent img");
var pTag = $(this).find(".templatecontent p");
if (img.attr("src") !== undefined) {
$(this).css({
"background-image": "url(" + img.attr("src") + ")",
});
img.remove();
}
// get rid of the pesky p tags
if (pTag.length) {
pTag.remove();
}
});