title: How do I display fields in the first 4 rows using PHP?
body: <p>So I am using ACF (Advanced Custom Fields) and I would like to display the first four rows. Although I have 20 rows in all I only need to display the fields in the first five rows or the last 5 rows</p>
  
  <p>Also, my code doesn't need to be in a loop so I am open to any answer. I only placed my code in a loop because it's the only way that I know how to display repeater sub fields. I am pretty new to using ACF fields</p>
  
  <pre><code>&lt;?php
  
      // check if the repeater field has rows of data
  
      if( have_rows('repeat_field') ):
  
        // loop through the rows of data
          while ( have_rows('repeat_field') ) : the_row();
  
              // display a sub field value
  
                the_sub_field('place_name');
                the_sub_field('place_date');
                the_sub_field('place_time');
  
  
          endwhile;
  
      else :
  
          // no rows found
  
      endif;
  </code></pre>