Solving the WordPress Excerpt Problem - Sorta

The WordPress Blog Excerpt Problem (as I call it) came from the desire to have the first page of my blog, index.php, show only excerpts of the blogs instead of the default, the entire blog. I could easily change the number of blogs shown on the entry page through Options, but I couldn’t figure out how to show the excerpts.

There is a plug-in to make excerpts show automatically, but I can’t get that to work either, even after asking in the Wordpress Forums, which are usually terrific. Guess my question was too simple.

Anyway, I haven’t solved the Excerpts plug-in problem, but I now have a better understanding of the problem and how to make this work without the plug-in. It’s so simple, it really gets me that it wasn’t explained in a simple fashion.

In the WordPress editing window on the quicklinks bar there is a tag for “more“. In the place you want a link for “more” to be seen on the main index.php page, click on the “more” tag. It puts a jump link in the blog which appears on the main page making the blog entry appear to be an excerpt.

So your line in your entry would look like this:

This is the last line of a blog entry with a paragraph underneath and I'm writing it today. <!--more-->

This is the second paragraph I’m writing underneath that isn’t seen on the first index.php page but will be seen with the entire blog entry when you click the “more” jump hyperlink.

This creates a link that jumps to your full blog entry and then down to the targeted link point so the reader can keep reading at the spot. In the full blog entry, the jump link is gone as that is the target point. Very slick.

Where you set the “more” tag, it shows up. If you set it at the end of the line, it will show up at the end of the line. If you set it between two lines, in the blank “line” between paragraphs, it will show up under your last text line on a new line on the index.php page, but on your main blog entry, it will not show the “blank” line between paragraphs (if this is your style) but no line between those two paragraphs. The link shows up where you put it and you have to take that into consideration on where you put the “more” link tag.

I’ve edited back an entire month to put the “more” tag in my blog entries and now the first page looks great with “excerpts” instead of the whole entry. I’m thrilled.

Lorelle
Tulsa, Oklahoma

> > > Later: There is a new section in the WordPress Documentation site called the Codex that goes into great detail about how to use this more quicktag button and how to customize it. You can find it at Customizing the Read More for Excerpts for WordPress.

Even Later: The answer was much easier than I thought. In the index.php template file, or any WordPress template file that displays more than one post at a time, like the archives, search, category, etc., simply find the_content() template tag and change it to the_excerpt(). Instant excerpts. Wow! Too simple.

random images, photography by Lorelle and Brent VanFossen - copyrighted

Authors, photographers, teachers, and public speakers, Lorelle and Brent VanFossen, travel extensively with their camera and pen in hand to bring you a variety of articles on nature and travel photography including basic nature photography and the photography business, writing, travel, recreational vehicles, web page design, and life on the road. All images, design, and content are copyrighted and protected by law.

You can find related articles to this topic in our WordPress and Photography categories. The previous post is Setting Up the Blog and the next post is WordPress and Other Blog Details. Solving the WordPress Excerpt Problem - Sorta, Issue Number 437, by Lorelle VanFossen, was updated July 16th, 2006.

You can follow comments through the RSS 2.0 feed and you can find more feeds on our Feeds List. Your comment is welcome, as are trackbacks from your site.

Related Articles

Submit Article: BlinkList | Blogmarks | Digg | Del.icio.us | Ekstreme Socializer | Feedmarker | Furl | Google Bookmarks | ma.gnolia | Netvouz | RawSugar | Reddit | Scuttle | Shadows | Simpy | Spurl | Technorati | Unalog | Wink | Yahoo MyWeb2

9 comments from people who had something to say

RSS feed for comments on this post. TrackBack URI

People are talking here

  1. Adam said:
    April 24, 2005

    I was trying to solve this problem the whole day, I have searched the forum, all faqs but failed to find an answer. Luckily I found your site, and the solution is stupidly simple. I don’t know why they put the button “more” with all the other buttons there, it should have been highlighted somehow that this is an excerpt button or something. Anyway Lorelle thanks a lot for your solution.

  2. Lorelle VanFossen said:
    April 24, 2005

    Glad to help. This caused me no end of nightmares trying to figure it out. Be sure and check the new WordPress Lessons section for some great tips and how tos on using WordPress. That’s where I finally found my fix.

  3. Marino said:
    May 21, 2005

    I solved it showing only the excerpts on main page but the whole post when read alone. It’s easy :)

    In your template, where the_content is used, replace it by:

    <?php if (is_home()) {
    the_excerpt();
    } else {
    the_content(__(’(more…)’));
    }
    ?>

    So, use the is_home() function to decide if to show only the excertp or the full post.

  4. Lorelle VanFossen said:
    May 22, 2005

    Let me think for a minute. Garbly gook PHP or clicking a “more” button? Hmmm, which is easier? ;-)

    A lot of people have trouble with this, and once they discover the “more” button, life is easier. Trying to actually change the PHP WordPress Loop, that’s straining the brain cells for a lot of folks.

    In the end, in an article I haven’t posted yet, I used your solution, but even more complex. But the “more” quicktag is still a sweet and easy method.

    Thanks!

  5. Pippo said:
    December 18, 2005

    Ahhhh finally I found it!
    thanks :)

    But still, when I go in category listtings, I see the whole posts :(
    Since I make long posts with lots of downloads and flash examples, is messy for me…
    anybody a solution for category index pages?

    thx
    www.pippoflash.com

  6. Waldo Calderon said:
    August 8, 2006

    This info was really usefull. I though the optional excerpt was used as a preview feature. That’s how they do it in Post-Nuke and Php-Nuke. Thanks for posting this.

  7. Oak said:
    January 18, 2010

    THANK YOU FOR THIS POST!!!!!!!!!! I had no idea the “More” tag existed and it solved my problem. :)))

Trackbacks and Pingbacks: What People are Saying

  1. […] Am besten leite ich diesen Post mit einem Zitat aus folgender Quelle ein: Guess my question was too simple. […]

    Pingback by streichardt.net » Weiterlesen? — March 12, 2006 @ 3:38

  2. […] Solving the WordPress Excerpt Problem - Sorta […]

    Pingback by Lorelle on WordPress » Display Post Excerpts Only in WordPress — July 19, 2006 @ 8:29

Have Something to Add?

All comments are moderated, so play nice.