• Official support site is having issues (503/timeout) so I though I’d post here.

    I’m using the repeater successfully and recently had an issue where every other row is displaying (not all).

    Here’s my code:

    <?php if( have_rows('lma_dates') ): while ( have_rows('lma_dates') ) : the_row(); ?>
    <?php
    $res=the_row();
    $time = $res['date'];
    if ($time >=  date('m/d/Y')){ ?>
    <div class="lma-day">
    <div class="lma-date"><?php the_sub_field('date'); ?></div>
    <div class="lma-rate"><?php the_sub_field('rate'); ?></div>
    <div class="lma-details"><?php the_sub_field('details'); ?></div>
    </div>
    <?php } ?>
    <?php endwhile; ?>
    <?php else : ?>
    <?php endif; ?>

    I run a check to hide rows that include a date earlier than today. The problem seems to have arose after we implemented this check (although not sure if it’s the cause)

    https://wordpress.org/plugins/advanced-custom-fields/

Viewing 1 replies (of 1 total)
  • Thread Starter Josiah

    (@colewebdev)

    Fixed this, it was related to the code that checks for past dates.

    Here’s the new code in case anyone else wants to re-use:

    <?php
    //$res=the_row();
    $time = $res['date'];
    if ($time >=  date('m/d/Y')){ ?>

    I left in the commented out line, so you can see what we had to change.

Viewing 1 replies (of 1 total)
  • The topic ‘Repeater Showing Only Every Other Row’ is closed to new replies.