Answer the question
In order to leave comments, you need to log in
How to display a group of fields in acf?
How to display a group of fields in acf ?
already worn out
there is a group group_1
it has fields
img_1
link_1
how to display?
according to the manual, I can’t understand how to do it, it only displays the image in a loop
<?php $group_fields = get_field('имя_поля_с_типом_группа'); ?>
<?php if ($group_fields) { ?>
<?php foreach ($group_fields as $key => $item) { ?>
<?php if ($item) { ?>
<img
src="<?php echo esc_url($group_fields[$key]['sizes']['large']); ?>"
alt="<?php echo esc_attr($group_fields[$key]['alt']); ?>"
class="responsive"
>
<?php } ?>
<?php } ?>
<?php } ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question