title: Advanced Custom Fields Repeater With 2 Loops
body: <p>I am setting up a photo gallery, with a main image and 6 thumbnails under it. Upon hovering the thumbnail, the main image will change. Simple stuff. The problem I am having is that when the page loads, the main image is the image from the first repeater row (like I want), but then in the thumbnails, the first repeater row doesn't get output. So only thumbnails 2 - 6 are being output. I am new to Advanced Custom Fields. Not sure if it's something to do with that or if it's just a simple PHP error. Here is my code:</p>
  
  <pre><code>&lt;?php if( have_rows('property_images') ): 
  
      while( have_rows('property_images') ): the_row();
  
          $image = get_sub_field('property_image');
          $url = $image['url'];
  
      ?&gt;
  
      &lt;img src="&lt;?php echo $url ?&gt;" class="property-main-img"&gt;
  
      &lt;?php
          break;
          endwhile;
          endif; 
      ?&gt;
  
              &lt;ul&gt;
  
                  &lt;?php if( have_rows('property_images') ): 
  
                          $i = 1;
  
                          while( have_rows('property_images') ): the_row();
  
                              $image = get_sub_field('property_image');
                              $url = $image['url'];
  
                          ?&gt;
  
                          &lt;?php if($i % 3 == 0) { ?&gt;
  
                              &lt;li class="prop-thumb-r"&gt;&lt;img src="&lt;?php echo $url ?&gt;" alt="&lt;?php echo $image['alt']; ?&gt;" width="170" /&gt;&lt;/li&gt;
  
                          &lt;?php } else if($i == 1 || $i % 4 == 0) { ?&gt;
  
                              &lt;li class="prop-thumb-l"&gt;&lt;img src="&lt;?php echo $url ?&gt;" alt="&lt;?php echo $image['alt']; ?&gt;" width="170" /&gt;&lt;/li&gt;
  
                          &lt;?php } else { ?&gt;
  
                              &lt;li&gt;&lt;img src="&lt;?php echo $url ?&gt;" alt="&lt;?php echo $image['alt']; ?&gt;" width="170" /&gt;&lt;/li&gt;
  
                          &lt;?php } ?&gt;
  
                          &lt;?php
                               $i++;
                           endwhile; 
                      endif; 
                  ?&gt;
  
              &lt;/ul&gt;
  </code></pre>