Support

Account

Home Forums Add-ons Flexible Content Field Count flexible field sub fields Reply To: Count flexible field sub fields

  • Hi @freshyill

    Something like the below should work for you:

    <?php 
    $count = 0;
    while( has_sub_field("content") ) : 
    
        if(get_row_layout() == "page_break") :
    	
            if(get_sub_field('break_here')){
               $count++;	
               echo $count;
            }
          
        endif;
          
    endwhile; ?>