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

  • 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
          ?>