Support

Account

Home Forums Add-ons Repeater Field Random repeater Reply To: Random repeater

  • I was having a lot of trouble with this as well, especially with the attached images. Here is what I ended up with:

    <?php 
      $rows = get_field('partners'); 
      if($rows) $i = 0; { 
        shuffle( $rows ); 
        foreach($rows as $row) { 
          $i++; if($i==6) break; 
          $image = $row['partner_logo']; ?>
    
          <li class="partners-list-item desaturate"><img src="<?php echo $image; ?>" alt="" /></li>
    <?php } } ?>