Home › Forums › General Issues › ACF Repeater Excerpt › Reply To: ACF Repeater Excerpt
Not really, You’ll need to create your own function that does everything that WP does.
// add something like this to functions.php
function fredy_custom_excerpt($text) {
$text = strip_shortcodes( $text );
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
$excerpt_length = apply_filters('excerpt_length', 55);
$excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
return wp_trim_words( $text, $excerpt_length, $excerpt_more );
}
‘
// when getting the field
echo fredy_custom_excerpt(get_sub_field(‘wysiwyg_field_name’));
‘
the function was taken from here and changed as needed http://wordpress.stackexchange.com/questions/37618/apply-filters-and-the-excerpt-are-giving-unexpected-results
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.