+27 (0)82 4155 799 info@3dom.agency

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.