Need to change the default excerpt length in WordPress to make it longer or shorter. All you may need is to add a function to your WordPress theme’s functions.php file.
1 answers
1
Adding custom excerpt lengths to WordPress
To change the default excerpt length in WordPress, you need to add a function to your WordPress theme’s functions.php file.
- Navigate to Appearance > Editor > Theme Functions from your WordPress Dashboard;
- Copy and paste the code below;
- Click Update File to save the changes.
function custom_excerptlength( $length ) { return 20; } add_filter( 'excerpt_length', 'custom_excerptlength' );
— Support WizardAnswer 1