Support

Account

Home Forums Add-ons Repeater Field repeater field not returning data Reply To: repeater field not returning data

  • Here’s my whole section of code. The two repeaters are pretty much the same. I just refactored the second one a little and added the ‘no rows found’ echo.

    <section id="faq" class="white section6">
    <div class="container">
      <div class="row">
        <div class="col-md-12" style="padding:70px 15px 0;">
          <h3 align="center">FAQ</h3>
        </div>
      </div>
      <div class="row table-row">
        <div class="col-sm-6" style="padding:15px 15px 75px;">
          <?php if ( have_rows('faq') ) : ?>
          <?php while ( have_rows('faq') ) :
          the_row();  ?>
          <div class="faq-accordian">
            <div class="title"><?php the_sub_field('question'); ?></div>
            <div class="copy"><?php the_sub_field('answer'); ?></div>
          </div>
          <?php endwhile; ?>
          <?php endif; ?>
        </div>
        <div class="col-sm-6" style="padding:15px 15px 75px;">
          <?php if ( have_rows('faq_column_2') ) :
          while ( have_rows('faq_column_2') ) :
          the_row(); ?>
          <div class="faq_accordian">
            <div class="title"><?php the_sub_field('question_col2'); ?></div>
            <div class="copy"><?php the_sub_field('answer_col2'); ?></div>
          </div>
          <?php endwhile;
          else :
          echo ('no rows found');
          endif; ?>
        </div>
      </div>
    </div>
    </section>