solid-pixel
3/21/2017 - 1:06 PM

Set ACF image (ID) as Background

Set ACF image (ID) as Background

<?php

$imgID = get_field('field_slug');
$imgSize = "large"; // (thumbnail, medium, large, full or custom size)
$imgArr = wp_get_attachment_image_src( $imgID, $imgSize );

// $url = $image[0];
// width = $image[1];
// height = $image[2];

?>

<div id="post-splash" style="background-image: url(<?php echo $imgArr[0]; ?> );">

</div>