Trim Custom Excerpts
A custom excerpt allows you to write exactly what you want shown for the excerpt. Because of this, when the theme detects a custom excerpt, it displays the full text without trimming it. If you’re using elements like Post Cards and specify a custom excerpt length, any post with a custom excerpt will ignore that length and show the entire excerpt instead. However, if you want to trim custom excerpts as well, you can use the following snippet:
// Trim custom excerpts
add_filter( 'totaltheme/post/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)
We recommend Code Snippets (100% Free) or WPCode (sponsored)
Related Snippets