Adding to $count with ACF flexible content
-
I have a flexible content template for single-news.php that includes a repeater. How do I add up all the reading time for that post?
I need to get the count of words for get_sub_field(‘content’)—there may be multiple instances of it (i’ve removed other row layouts for readability). Here is the code that is in the template I am hoping to get a count of.if(have_rows('panels')): while(have_rows('panels')) : the_row(); if(get_row_layout() == 'content'): $output .= '<section class="row clearfix">'; $output .= get_sub_field('content'); endif; endwhile; echo $output; endif;
Any ideas? I know there is a way to use this filter, but i can’t quite figure it out:
add_filter( 'rtwp_filter_wordcount', 'up_the_count' );
Thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Adding to $count with ACF flexible content’ is closed to new replies.