Support

Account

Home Forums Add-ons Options Page Select specific repeater rows from an options page Reply To: Select specific repeater rows from an options page

  • 
    <?php 
      // displaying the values
      $selection = get_field('service_select');
      if (!empty($selections)) {
        if (have_rows('services', 'options')) {
          while (have_rows('services', 'options')) {
            the_row();
            $title = get_sub_field('service_title');
            if (in_array($title == $selection)) {
              // get the other sub fields after checking 
              // instead of getting values that may not be needed
              $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');
              ?>
                <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
    ?>