Our website was designed by third party, and there is an ACF image on the front page that I would like to change to a random image that would be different each time a user reloads the page. I have found this code that seems like it would work, but I’m not sure where I need to place this code:
<?php
$images = get_field(‘header_image’, ‘option’);
$rand = array_rand($images, 1);
if( $images ): ?>
<div>
” alt=”<?php echo $images[$rand][‘alt’]; ?>” />
</div>
<?php endif; ?>
I am not a coder by any stretch of the imagination, but I’m comfortable changing files over FTP. I always just create a backup of the file first just in case I FUBAR something. Can anyone help me out?
Thanks!