Support » Fixing WordPress » I can't change excerpt length, even with plugins

  • Resolved Colby Ross


    Hello, I’m fairly new to wordpress, but I have a site up and running at:

    The problem is that instead of showing a certain amount of characters or words in the post excerpt, it just shows the entire post.

    I’ve tried adding this code to my theme’s functions.php file, but it does nothing:

    function custom_excerpt_length( $length ) {
    	return 20;
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

    I’ve also tried out a few plugins like Excerpt Length and Advanced Excerpt, but nothing works.

    I’ve tried using the Twenty Eleven theme and the Twenty Ten theme, but neither of those work with the two plugins I wrote about above.

    Could someone please help me with this? I need to change the amount of words in the post excerpt. Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Are you filling in the Except’s metabox? Are you using the more button?

    There are many different ways themes split content for excerpt (and note in cases some users forget to split there content, and in other cases theme authors forget to write all splitting methods)

    I tried filling in the Excerpt box, but it did nothing. No matter what theme I used, even on the Twenty Eleven theme, it would not work.

    I did try the more button, which I didn’t even know existed (thank you), and that did work.

    But I would prefer if I could use excerpts, and so far it would not work, I don’t believe it has anything to do with the theme I am using, because I can’t get it to work on any theme.



    Forum Moderator

    Twenty Ten and Twenty Eleven do not use the excerpt code on the index page; so they are bad examples to test your plugins.

    for the excerpt to show, you need to edit the template which shows the front/posts page (often index.php; but loop.php in Twenty Ten, and content.php in Twenty Eleven) and change the code to use the_excerpt() instead of the_content()

    as you are using a custom theme, have a look at to identify what template to edit.

    I couldn’t try the above method because I found that “the_content()” doesn’t even exist in my template. I found this out by searching for “the_content()” in all the files in my template folder using Notepad++.

    I did see that “the_content()” exists in Twenty Ten and Twenty Eleven, so I went into Twenty Ten and changed “the content()” to “the excerpt()”, and it still did nothing.



    Forum Moderator

    your theme might have the_content('read more') or so – try to search for just the_content

    or try to get in contact with whoever made your theme…

    Okay, I did that.

    In /helpers/system.php, it says:
    remove_filter('the_content', 'wpautop');

    In /layouts/page.php, it says:
    <div class="content clearfix"><?php the_content(''); ?></div>

    In /layouts/single.php, it says:
    <div class="content clearfix"><?php the_content(''); ?></div>

    In /layouts/_post.php, it says:
    <div class="content clearfix"><?php the_content(''); ?></div>

    Could you please tell me which one I have to edit, and what I edit it to?



    Forum Moderator

    my guess would be:

    in /layouts/_post.php,

    and change it to:

    <div class="content clearfix"><?php the_excerpt(); ?></div>

    That did the trick. Thank you very much!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘I can't change excerpt length, even with plugins’ is closed to new replies.