Home › Forums › Add-ons › Options Page › Select specific repeater rows from an options page › Reply To: Select specific repeater rows from an options page
Yes my code is below
<?php // displaying the values
$selections = get_field('service_select');
// this is assuming that the select field returns an array of selected values
if (!empty($selections)) {
if (have_rows('services', 'options')) {
while (have_rows('services', 'options')) {
the_row();
$title = get_sub_field('service_title');
$icon = get_sub_field('service_icon');
$title = get_sub_field('service_title');
$teaser = get_sub_field('service_teaser');
$description = get_sub_field('service_description');
$link = get_sub_field('service_link');
if (in_array($title, $selections)) {
// get other sub fields from the repeater and display here ?>
<div class="callout" data-equalizer-watch="callout">
<img src="<?php echo $icon['url']; ?>" alt="<?php echo $icon['alt'] ?>" />
<h5 class="text-center"><?php echo $title ?></h5>
<p class="text-center"><?php echo $teaser ?></p>
</div>
<?php } // end if selection is selected
} // end while have rows
} // end if get field
} // end if !empty
?>
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.