3DOM Digital Agency Web Development | Digital Marketing | IT Repairs & Sales
Close Preloader Screen

Stay Ahead with the Latest News

How to increase the excerpt length on WordPress

Your Digital Edge Starts Here

by | Sep 8, 2016

Are you displaying excerpts on your WordPress blog without any excerpt related plugins?  Do you want to control the length of the excerpts?  This method is great if you do not want to use plugins to control the length of your excerpts.

Use the code below that you can insert into the file plugins.php on the root of your theme folder to increase or decrease the excerpt length.

// Changing excerpt length

function new_excerpt_length($length) {
return 100;
}
add_filter(‘excerpt_length’, ‘new_excerpt_length’);

// Changing excerpt more
function new_excerpt_more($more) {
return ‘…’;
}
add_filter(‘excerpt_more’, ‘new_excerpt_more’);

NB: Add the above code before the closing ?> tag in functions.php.

Related Post

0 Comments