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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.