Support

Account

Home Forums General Issues Getting a count of repeater sub fields Reply To: Getting a count of repeater sub fields

  • I’m trying to echo the count of the rows, but it keeps returning zero. Here is my code:

    <?php if( have_rows('repeater_name') ):
    	$my_fields = get_field_object('repeater_name');
    	$count = (count($my_fields['value']));
    	echo $count;
    endif;?>

    I have 3 repeater rows but it keeps returning “0”. Any idea why?