Support

Account

Home Forums Add-ons Repeater Field Return one row of nested repeater sub_fields Reply To: Return one row of nested repeater sub_fields

  • Yeah for solutions!

    http://stackoverflow.com/questions/21135959/get-first-row-image-of-acf-repeater-field

    My Code

     <?php $first_mm_stats = true; ?
           <?php while ( $first_mm_stats && have_rows('mm-stats') ) : the_row(); ?>
    
            <?php $first_article_stat = true; ?>
                 <?php while ( $first_article_stat && has_sub_field('article_stat') ): ?>
    
                <h4><?php the_sub_field('name'); ?></h4>
                <div class="stat-box" rel="tooltip" data-toggle="tooltip" data-placement="top" title="Last Year to Date">
                  <p class="value">
                    <?php the_sub_field( 'value' ); ?><i class="fa fa-info-circle"></i>
                  </p>
                  <p class="indicator <?php the_sub_field('indicator'); ?>">
                    <i class="fa fa-arrow-<?php the_sub_field('indicator'); ?>"></i><?php the_sub_field( 'percent' ); ?>% <label><span>Lytd</span></label>
                      
                  </p>
                </div>
                <a class="read-more" href="<?php the_permalink(); ?>">More Stats</a>
                  
                      <?php $first_article_stat = false; ?>
                  <?php endwhile; ?>
                  
                  <?php $first_mm_stats = false; ?>
              <?php  endwhile; ?>
    
      </div>