Skip to content

Snippet: Use Core WordPress get_the_excerpt Function for all Excerpts

By default Total uses a custom function to generate excerpts in various Total page builder modules and blog/post type entries. This is to allow for custom excerpt lengths across the site. However, if you are using a plugin to modify excerpts (such as custom excerpt translations) you may need to instead use the core WordPress function (which is unfortunately more limited). The following code alters the default WordPress excerpt function to use the native one in WordPress.

add_filter( 'wpex_excerpt_args', function( $args ) {
    $args['custom_output'] = get_the_excerpt();
    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