Excerpt not working in Wordpress?

4 replies
  • WEB DESIGN
  • |
Hi,

I've just setup a wordpress site and posted two articles. On the different pages (categories and tags) I want it to only show an excerpt of the article and link to it. However it shows the whole article.
For each article I've written a couple of lines as excerpt (I found the excerpt field by finding the 'hidden' checkbox). I've also setup 'Reading Settings' to show 'Summary for each article in a feed'.
It still shows the whole articles on the different pages.

What am I missing here?

I've read something about editing an index.php, but which one is it and is that really necessary?

I'm using the standard Twenty-Eleven theme.

Thanks, guys.

Best regards,
Thomas
#excerpt #wordpress #working
  • Profile picture of the author WPCHARLIE
    1) open archive.php (WP admin --> Appearance --> Editor --> Archive.php)
    2) Find this snippet:

    Change:
    the_content();
    TO
    the_excerpt();

    OR if you see the following:
    Change
    <?php the_content(); ?>
    TO
    <?php the_excerpt(); ?>

    One of them will exist in that file.

    3) Save file. Refresh browser.
    {{ DiscussionBoard.errors[4338292].message }}
  • Profile picture of the author ThomasTe
    Thanks, WPCharlie, however, I cannot find 'the_content()' anywhere in that file.
    Is there another place it could be located?

    Thanks.

    Best regards,
    Thomas
    {{ DiscussionBoard.errors[4341760].message }}
  • Profile picture of the author Istvan Horvath
    Is there another place it could be located?
    Yes.

    And in the theme you are using (2011) it is not there - which shows the above reply was given without checking the facts :p

    It is in content.php and, unfortunately, it's way more complicated than in earlier versions

    On line #35 replace this
    <?php if ( is_search() ) : // Only display Excerpts for Search ?>

    with this:
    <?php if ( is_search() || ( is_category) ) : // Only display Excerpts for Search and Category ?>
    Signature

    {{ DiscussionBoard.errors[4342250].message }}
  • Profile picture of the author ThomasTe
    Great, thanks alot, Istvan. It works.

    Best regards,
    Thomas
    {{ DiscussionBoard.errors[4346987].message }}

Trending Topics