Home › Forums › Front-end Issues › Repeater Returning Type boolean instead of Array › Reply To: Repeater Returning Type boolean instead of Array
Seems like the get_field(‘repeating_content’) function is returning a boolean value instead of an array. Maybe you can check if the field exists and if it’s returning the expected value.
$repeating_content = get_field(‘repeating_content’);
// Check if $repeating_content is an array before counting its rows
if (is_array($repeating_content)) {
$numrows = count($repeating_content);
echo “Number of rows: $numrows”;
} else {
echo “Error: Unable to retrieve repeating content.”;
}
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.