WordPress.org

Support

Support » Plugins and Hacks » Facebook » [Resolved] [Plugin: Facebook] TwentyTen Excerpt Cruft

[Resolved] [Plugin: Facebook] TwentyTen Excerpt Cruft

  • I was troubleshooting one of my sites running a child theme based on Twenty Ten. I noticed that the description wasn’t coming over properly.

    Twenty Ten by default adds a custom hook to excerpt_more called twentyten_auto_excerpt_more that adds lots of HTML cruft to the excerpt.

    If you’re using Twenty Ten as a parent, you can add this code to your child theme to eliminate this:


    add_action( 'after_setup_theme', 'my_child_theme_setup' );
    function my_child_theme_setup() {
    remove_filter('excerpt_length', 'twentyten_excerpt_length');
    remove_filter('excerpt_more', 'twentyten_auto_excerpt_more');
    add_filter('excerpt_length', 'my_child_excerpt_length');
    add_filter('excerpt_more', 'my_child_excerpt_more');
    }

    function my_child_excerpt_length() {
    return 60;
    }

    function my_child_excerpt_more($output) {
    return '';
    }

    http://wordpress.org/extend/plugins/facebook/

  • The topic ‘[Resolved] [Plugin: Facebook] TwentyTen Excerpt Cruft’ is closed to new replies.
Skip to toolbar