Modifying your post excerpts
March 15, 2011 – 9:14 am |This is my personal favorite way of modifying excerpts, I found all this information on the WordPress codex excerpts page.
I think that the WordPress excerpt is a little bit short so the code below will extend it to 120 words. Also, by default WordPress only shows the [...] at the end of the excerpt, which doesn’t help my readers when they get to the end of the text.
-
/**
-
* The Read More link after the post excerpt
-
*/
-
function new_excerpt_more($more) {
-
global $post;
-
return '… <a href="'. get_permalink($post->ID) . '">» Read More</a>';
-
}
-
add_filter('excerpt_more', 'new_excerpt_more');
-
-
/**
-
* This changes the length of the excerpt to 120 words
-
*/
-
function new_excerpt_length($length) {
-
return 120;
-
}
-
add_filter('excerpt_length', 'new_excerpt_length');


Pingback: » WordPress Relief – @wprelief – Always have “Read More” on Manual and Automatic excerpts