Home › Forums › General Issues › How to select multiple options from specific repeater row? › Reply To: How to select multiple options from specific repeater row?
For anyone interested, or has had the same issue, I solved this myself. Value to become values and the singular value to loop through each array item:
<?php
$field = get_field_object('choices');
$values = $field['value'];
foreach ($values as value) :
$rows = get_field('gallery_repeater', 'option');
$specific_row = $rows[$value];
$sub_field_value = $specific_row['gallery'];
?>
<?php foreach ($sub_field_value as $img) : ?>
<div data-src="<?php echo esc_url($img['sizes']['large']); ?>" title="<?php echo esc_attr($img['title']); ?>">
<img />" alt="<?php echo esc_attr($img['alt']); ?>" title="<?php echo esc_attr($img['title']); ?>" />
</div>
<?php endforeach ?> // $img
</div>
<?php endforeach ?> // $value
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.