I always set ACF to return “ID” (not object or URL) – that way ACF doesn’t get involved (& potentionally populate an object with vast amounts of data I don’t need) and I can do as I wish:
<?php
$landing_slideshows = get_field( 'landing_slideshow' );
// var_dump( $landing_slideshows );
foreach( $landing_slideshows as $landing_slideshow ) : ?>
<div class="landing-photo clear"<?php
$image_id = $landing_slideshow['landing_slide'];
$src = wp_get_attachment_image_src( $image_id, 'large' );
// Only print style bg if image valid & exists, unlikely but good practice
if ( $src ) {
// $src is an array with 3 items: URL, width, height
printf( ' style="background-image: url(%s);"', $src[0] );
}
?>><?php
// var_dump( $image_id );
// var_dump( $src );
?></div>
<?php endforeach ?>