Good day. 'sertificates_gallery' is the gallery ID from the Advanced Custom Fields. Tried also through foreach as in documentation, but it didn't work out. My code now looks like this:
$image = get_field('сertificates_gallery');
$size = 'thumbnail';
if( $image ) {
echo wp_get_attachment_link( $image, $size );
}
Actually, you are trying to get the array, so you will need to do in the loop, Please check this link
$image = get_field('сertificates_gallery');
$size = 'thumbnail';
foreach( $image as $single_image ):
echo wp_get_attachment_link( $single_image['ID'], $size );
endforeach;
UPD:
<?php
$images = acf_photo_gallery('сertificates_gallery', get_the_ID());
if( $images ): ?>
<div class="images">
<?php foreach( $images as $image ): ?>
<?php echo $image['thumbnail_image_url']; ?>
<?php endforeach; ?>
</div>
<?php else : ?>
no certificates yet
<?php endif; ?>