Created
March 2, 2017 16:45
-
-
Save solid-pixel/1d2084c9356a65fae5e0f04bb0ee7621 to your computer and use it in GitHub Desktop.
Set ACF Object Image as Background
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$image = get_field('image_field_slug'); // the image field slug - set the field Return Value to 'Array' | |
$size = 'large'; // the image size | |
$thumb = $image['sizes'][ $size ]; //get the URL | |
echo '<div class="div-30" style="background:url(' . $thumb . ')"></div>'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment