Plugin Support
Elvin
(@ejcabquina)
Hi there,
Are you using manual excerpt on your posts? The excerpt length on the WPSP UI doesn’t work on manual excerpts. It is used for the automatic excerpt.
If you want to trim your manual excerpts, you can try this PHP snippet:
function 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', 'manual_auto_excerpt', 5);
Hi there,
thank you very much. I could solve this problem.
Plugin Support
Elvin
(@ejcabquina)
Nice one. glad you can sort it out.:)