On WordPress 2.9 there are new featured that we can added on the_excerpt(), one of them is change the excerpt length. How to modify Custom excerpt length is really simple. We only needed to put some function on our functions.php themes file and added some hook to call this functions.
Write down Custom excerpt length below
<?php
// Add custom excerpt length
function custom_excerpt_length($length) {
return 20;
}
add_filter('excerpt_length', 'custom_excerpt_length');
?>
And done, you have new excerpt length, please note you can modify the value of 20, you can added whatever you want. Or if you want totally new version and using your own excerpt, you can follow our tutorial to create Own Excerpt in WordPress. You can tried using plugin on this method



Help please,
i keep getting this error. i am using thesis theme and this is how my functions are
add_filter(‘the_excerpt’, ‘my_excerpts’);
// Function to replace ellipsis with text
function my_excerpt($text) {
return str_replace(‘[...]‘, ”, $text);
}
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘my_excerpts’ not found or invalid function name in C:\xampp\htdocs\wordpress\wp-includes\plugin.php on line 166
@anar
You used ‘my_excerpts’ plural in the add_filter call, but you defined function my_excerpt singular (without the ‘s’).
Thanks for help. I’ve solved the problem.
[...] How to modify Custom excerpt length on WordPress # WordPress Tricks & Tips [...]