Support

Account

Home Forums Add-ons Repeater Field Need to show two Sub Fields on each div Reply To: Need to show two Sub Fields on each div

  • 
    <?php 
      if (have_rows('testimonials-int')) { 
        $count = 0;
        ?>
          <div class="row">
            <?php 
              while(have_rows('testimonials-int')) { 
                $count++;
                if ($count > 2) {
                  break;
                }
                the_row();
        
                $image = get_sub_field('avatar-int');
                $content = get_sub_field('content-int');
                $name = get_sub_field('name-int');
        
                ?>
                  <div class="medium-6 columns wrapper">
                    <img src="<?php echo $image; ?>" alt="Testimonials" />
                    <?php echo $content; ?>
                    <span><?php echo $name; ?></span>
                  </div>
                <?php 
              }
            ?>
          </div>
        <?php 
      }
    ?>