• I just posted this in a resolved thread. So here it is again in an unresolved thread. Admin please delete if this isn’t correct.

    I’d like to remove the shortcodes from the_excerpt too. But I can’t get it to work. Is my functions.php correct?

    <?php
    if ( function_exists('register_sidebar') )
    register_sidebar(array('name'=>'Main Sidebar',
            'before_widget' => '<li><div id="%1$s" class="%2$s">',
            'after_widget' => '</div></li>',
            'before_title' => '<h2 class="widgettitle">',
            'after_title' => '</h2>',
    		));
    register_sidebar(array('name'=>'Comments Sidebar',
            'before_widget' => '<li><div id="%1$s" class="%2$s">',
            'after_widget' => '</div></li>',
            'before_title' => '<h2 class="widgettitle">',
            'after_title' => '</h2>',
    		));
    register_sidebar(array('name'=>'Footer Sidebar',
            'before_widget' => '<li><div id="%1$s" class="%2$s">',
            'after_widget' => '</div></li>',
            'before_title' => '<h2 class="widgettitle">',
            'after_title' => '</h2>',
    		));
    add_filter('the_excerpt', 'do_shortcode');
    ?>

    Thanks for the help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try This:

    <?php
    if ( function_exists('register_sidebar') ) {
    register_sidebar(array('name'=>'Main Sidebar',
            'before_widget' => '<li><div id="%1$s" class="%2$s">',
            'after_widget' => '</div></li>',
            'before_title' => '<h2 class="widgettitle">',
            'after_title' => '</h2>',
    		));
    register_sidebar(array('name'=>'Comments Sidebar',
            'before_widget' => '<li><div id="%1$s" class="%2$s">',
            'after_widget' => '</div></li>',
            'before_title' => '<h2 class="widgettitle">',
            'after_title' => '</h2>',
    		));
    register_sidebar(array('name'=>'Footer Sidebar',
            'before_widget' => '<li><div id="%1$s" class="%2$s">',
            'after_widget' => '</div></li>',
            'before_title' => '<h2 class="widgettitle">',
            'after_title' => '</h2>',
    		));
    }
    add_filter('the_excerpt', 'do_shortcode');
    ?>

    I added {} around the content of the if block. That way the add_filter() call isn’t conditional upon register_sidebar. Hope that helps.

    Thread Starter Drew Baker

    (@dbaker)

    Hey RGlover,
    Thanks so much for the help, but it didn’t work. I’ve contacted the plugin author (Viper Videos) so maybe he can help.

    -Drew

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove shortcodes from auto excerpt’ is closed to new replies.