Support

Account

Home Forums Add-ons Repeater Field read more Reply To: read more

  • I use this if it helps@

    
    function custom_field_excerpt() {
    	global $post;
    	$text = get_field('overview');
    	if ( '' != $text ) {
    		$text = strip_shortcodes( $text );
    		$text = apply_filters('the_content', $text);
    		$text = str_replace(']]>', ']]>', $text);
    		$excerpt_length = 10; // 20 words
    		$excerpt_more = apply_filters('excerpt_more', ' ' . '...');
    		$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
    	}
    	return apply_filters('the_excerpt', $text);
    }
    function custom_field_excerpt_longer() {
    	global $post;
    	$text = get_field('overview');
    	if ( '' != $text ) {
    		$text = strip_shortcodes( $text );
    		$text = apply_filters('the_content', $text);
    		$text = str_replace(']]>', ']]>', $text);
    		$excerpt_length = 25; // 20 words
    		$excerpt_more = apply_filters('excerpt_more', ' ' . '...');
    		$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
    	}
    	return apply_filters('the_excerpt', $text);
    }

    Just ensure you change this bit to your field name:
    $text = get_field('overview');

    Then to call it I use:
    <?php echo custom_field_excerpt_longer(); ?>

    Cheers