/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function improved_trim_excerpt($text) { global $post; if ( '' == $text ) { $text = get_the_content(''); $text = apply_filters('the_content', $text); $excerpt_length = 80; } } return $text; } remove_filter('get_the_excerpt', 'wp_trim_excerpt'); add_filter('get_the_excerpt', 'improved_trim_excerpt');
URL: http://www.milienzo.com/2007/09/02/improving-wordpress-the_excerpt-template-tag/