I am trying to use ACF repeater to call a random image on a wordpress site

This is my code, as aforesaid – i’m trying to get a single picture to echo inside a premade div out of repeater element. Despite working directly with the example on the website – I would love some help.

<?php 

$repeater = get_field('left_column_repeater' ); // get all the rows
$rand_row = $repeater[ array_rand( $repeater ) ]; // get a random row
$rand_row_image = $rand_row['left_column_image' ]; // get the sub field value 

// Note
// $first_row_image = 123 (image ID)

$image = wp_get_attachment_image_src( $first_row_image, 'full' );

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

<div class="circular" style="background-image: url('<?php echo $image[0]; ?>');"> </div>

Where did I go wrong?

Related posts