Support

Account

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