WordPress.org

Ready to get started?Download WordPress

Forums

Facebook
[resolved] TwentyTen Excerpt Cruft (1 post)

  1. CPilko
    Member
    Posted 1 year ago #

    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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags