Home › Forums › ACF PRO › Count acf repeater with radio value only › Reply To: Count acf repeater with radio value only
Not easily. To do that you would need to loop over the repeater rows and get that sub field for each row and then add it to the count.
// instead of $status = count( get_sub_field('sub_property_status') );
$status = 0;
if (have_rows('sub_property_status')) {
while(have_rows('sub_property_status')) {
the_row();
if (get_sub_field('radio') == 'published value') {
$status++;
}
}
}
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.