Support

Account

Home Forums General Issues How to display the number of the row of the repeater field ? Reply To: How to display the number of the row of the repeater field ?

  • @meneldil My quick go to your question as I was searching for the answer myself.

    if( have_rows('my_repeater') ):
      $i = 0; 
      while( have_rows('my_repeater') ): the_row(); 
        if( get_sub_field('sub_field_boolean') ) $i++;
     endwhile; 
      $tCount = $i;
    endif;

    ($tCount to produce the number of rows with a true field)