Hi everybody,
I have a gallery living inside a group field and don’t know how to target it.
Right now the images are not showing and since all else is fine I guess…
<?php
$studio = get_field('studio');
if( $studio ): ?>
...
<?php
$images = get_field('gallery');
$size = 'medium';
if( $images ): ?>
<ul>
<?php foreach( $images as $image ): ?>
<li>
<?php echo wp_get_attachment_image( $image['id'], $size ); ?></li>
<?php endforeach; ?>
<?php endif; ?>
...
<?php endif; ?>
Thanks in advance
https://www.advancedcustomfields.com/resources/group/
$images = get_field('{GROUP_FIELD_NAME}_gallery');
$group = get_field('{GROUP_FIELD_NAME}');
$images = $group['gallery'];
if (have_rows('{GROUP_FIELD_NAME}')) {
while (have_rows('{GROUP_FIELD_NAME}')) {
$images = get_sub_field('gallery');
}
}
Thanks for the hint, John.