• The function excerpt_length doesnt work in WordPress 3.1. I have added this code below to functions.php but no luck

    function new_excerpt_length($length) {
    	return 5;
    }
    add_filter('excerpt_length', 'new_excerpt_length');

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter denzel2364

    (@denzel2364)

    no ideas?

    which theme are you using? for instance the twentyten uses this to set excerpt length already….

    function twentyten_excerpt_length( $length ) {
    	return 40;
    }
    add_filter( 'excerpt_length', 'twentyten_excerpt_length' );

    just making sure you don’t have some sort of conflict

    Same problem here on a custom theme.
    Looks like twentyten has defined the function but never calls it anywhere.

    Nevermind, just call the function
    <?php the_excerpt();?>
    and it will works using the new filter.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘function new_excerpt_length not working in 3.1’ is closed to new replies.