Hi Rad,
Thanks for your reply. I was able to make this work (following your suggestion). So here it is, for user trying to achieve the same thing:
// Manual Excerpt Auto-Trim
// =============================================================================
function bac_manual_auto_excerpt($text) {
global $post;
$raw_excerpt = $text;
if ( '' == $text ) {
$text = get_the_content('');
$text = strip_shortcodes( $text );
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
}
$text = strip_tags($text);
/*** Change the excerpt words length. If you like. ***/
$excerpt_length = apply_filters('excerpt_length', 30);
/*** Change the Excerpt ending. If you like. ***/
$excerpt_end = ' <a href="'. get_permalink($post->ID) . '">' . '» Continue Reading.' . '</a>';
$excerpt_more = apply_filters('excerpt_more', ' ' . $excerpt_end);
$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
}
add_filter('get_the_excerpt', 'bac_manual_auto_excerpt', 5);
If you check the code there is a line that is setting the excerpt lenght to 30, It doesn’t work by itself. You will have to go to Theme Options / Blog and change the excerpt length. That will adjust the length of the manual excerpt on the category and archive pages for the blog.
Hope this helps.