Support

Account

Home Forums General Issues How to get count of rows in repeater, in flexible content Reply To: How to get count of rows in repeater, in flexible content

  • Do you have a loop for the flex field?

    
    if (have_rows('flex_field_name')) {
      while (have_rows('flex_field_name')) {
        if (get_row_layout() == 'column_blocks') {
          $num_rows = count(get_sub_field('columns'));
          // etc...
        }
      }
    }