WordPress.org

Support

Support » Plugins and Hacks » Viper's Video Quicktags » [Plugin: Viper's Video Quicktags] Vipers video tags with Advanced Excerpt

[Plugin: Viper's Video Quicktags] Vipers video tags with Advanced Excerpt

Viewing 1 replies (of 1 total)
  • I’ve managed to solve the problem of using videos with the excerpts using help from the http://aaronrussell.co.uk/legacy/improving-wordpress-the_excerpt/

    Before when I had it i had some custom excerpts which is why it was not showing unfortunately, stupid me. I had to alter the code slightly to the example given which is as follows…

    Place in the functions.php file of your theme and turn off and excerpt plugins.

    // Better excerpts to show the videos and solve the youtube issue.
    function improved_trim_excerpt($text) {
            global $post;
            if ( '' == $text ) {
                    $text = get_the_content('');
                    $text = apply_filters('the_content', $text);
                    $text = str_replace('\]\]\>', ']]>', $text);
                    $text = strip_tags($text, '<p><script><div><span><embed><object><iframe><img>');
                    $excerpt_length = 100;
                    $words = explode(' ', $text, $excerpt_length + 1);
                    if (count($words)> $excerpt_length) {
                            array_pop($words);
                            array_push($words, '...');
                            $text = implode(' ', $words);
                    }
            }
            return $text;
    }
    
    remove_filter('get_the_excerpt', 'wp_trim_excerpt');
    add_filter('get_the_excerpt', 'improved_trim_excerpt');
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Viper's Video Quicktags] Vipers video tags with Advanced Excerpt’ is closed to new replies.
Skip to toolbar