Skip to content

Snippet: Trim Custom Excerpts

By default the Total theme will not trim custom excerpts as usually the purpose of a custom excerpt is for the user to control exactly what is shown for the excerpt. However, it is possible to enable the trimming of custom excerpts with a little code.

add_filter( 'wpex_excerpt_args', function( $args ) {
	$args['trim_custom_excerpts'] = true;
	return $args;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top