Support

Account

Home Forums Add-ons Flexible Content Field get_field returns null for repeatable field in flexible content field Reply To: get_field returns null for repeatable field in flexible content field

  • I should also note that I am using get_template_part if get_row_layout matches a string. And I just tried moving this echo count( get_sub_field('testimonials_module' ) ); outside of the get_template_part and it works!

    I think I just found the issue but it is still super confusing. At the top of my template part I have this:

    if ( ! have_rows( 'testimonials_module' ) ) {
    	return;
    }

    If I call echo count( get_sub_field('testimonials_module' ) ); before this conditional it works fine but after it, it returns false. How would this effect the return of get_sub_field when that conditional is returning false?

    PHP version is 7.0.7. Valid question, but yet I am sure it is a repeater since the while( have_rows() ) loop is working and actually returning my data.

    Weird, right?! Thanks for responding.