Support

Account

Home Forums Front-end Issues Count repeats and display 'if' Reply To: Count repeats and display 'if'

  • If you do this for the repeater field

    
    $rows = get_field('video_profile');
    

    $rows will be an array of all of the rows in the repeater, then

    
    if (count($rows) == 0) {
      // no rows
    } elseif (count($rows) == 1) {
      // display 1 row
    } else {
      // display multiple rows
    }