Support

Account

Home Forums Add-ons Repeater Field future dates table in single.php Reply To: future dates table in single.php

  • Before your loop create a counter, increment it and then break when it gets to 6

    
    $count = 0;
    while ( have_rows('t_block') ) : the_row(); 
        $now = strtotime(date('Y-m-d', time()));
        // I am assuming that your date is stored as 'Y-m-d'
        // see strtotime php doc form more information
        $end_time - strtotime(get_sub_field('ende'));
        if ($now > $end_time) {
        // not in the future, go to the next row
            continue;
        }
        $count++;
        if ($count > 5) {
          // stop showing events
          break;
        }