WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: wordTube] Wordtube overwrites excerpt length (4 posts)

  1. elba00
    Member
    Posted 4 years ago #

    Hi,

    I just noticed that after installing wordtube my excerpts are set back to their default lenghts. I'm using WordTube 2.2.2 version.

    I use the following filter in my function.php:

    add_filter('excerpt_length', 'my_excerpt_length');
    function my_excerpt_length($length) {
    return 25; }

    When I deactive wordtube the filter works again.
    I tried to change the excerpt's lenghts in formatting.php:

    function wp_trim_excerpt($text) {
    	$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);
    		$excerpt_length = apply_filters('excerpt_length', 25);
    		$words = explode(' ', $text, $excerpt_length + 1);
    		if (count($words) > $excerpt_length) {
    			array_pop($words);
    			array_push($words, '[...]');
    			$text = implode(' ', $words);
    		}
    	}
    	return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
    }

    But the blog shows 55 characters, so I guess wordtube overwrites this function.

    I don't want to use plugins to change the length of the excerpt.
    Is there anyone who bumped into this problem? Any suggestion?

    Thanks. And thanks for the plugin.

  2. Jason
    Member
    Posted 4 years ago #

    Yeah I just came across the same problem. very frustrating.

  3. sarahd
    Member
    Posted 4 years ago #

    In the plugin's lib/shortcodes.php file you can change $excerpt_length (line 53).

  4. Mykola
    Member
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags