Pro Blog Design

Better Looking Blogs Grow Faster

First time? Start here.

Cut Out People
Photo by Linek
There are many reasons to choose to publish either full posts or excerpts on the homepage. Full posts are very simple to implement. You simply write, then publish. However, if you have chosen only partial posts, then Wordpress users have two different methods which will achieve the same effect.

Method 1: The More Tag

This method is usually the easiest of the two. When you have written your post, select where you would like to make the cut-off between the partial post for the homepage, and the rest of the page, then click the More button (More).

Your homepage, and category pages, will now display only the first section of the post, and a line of text linking to the rest of the article. This line defaults to, "Read the rest of this entry »", but can be easily changed. Open your index.php template file, and change the following line: (Make sure you retain the quotation marks!)

<?php the_content('Read the rest of this entry »'); ?>

Method 2: Post Excerpts Function

To use the post excerpts function, you will need to edit your template's files, namely those controlling your home and category pages (These will be home.php and category.php if you have them, and index.php if you don't). First off, replace the following line:

<?php the_content('Read the rest of this entry »'); ?>

with:

<?php the_excerpt(); ?>

Your pages will now show the excerpt. However, to load the post, your readers will have to click the post title. This isn't optimal (Why force your readers to scroll back upwards, to continue reading onwards?) . To solve this, we will add a link below the content, which can be used to load the rest of the article, similar to the one generated by the <!--more--> tag. Beneath the line we just edited, add the following:

<a href="<?php the_permalink(); ?>" title="Read the rest of <?php the_title(); ?>" class="more-link">Read the rest of this entry »</a>

It would also be recommended that you customise the text.

By default, Wordpress will now show the first 55 words of your post. You can change this however, by pasting what you want to be shown into the "Optional Excerpt" box in the Write Post screen. This box understands code, so if you intend upon including images in the excerpt, then you can copy and paste directly from the Code View on the Write Post page.

Through using this method, you can choose to display different text on the homepage than what is in the article. For instance, you may want to write a summary of the article to come, not merely quote the introduction. Another use is that if you choose to split the excerpt from the post in the middle of a list, you can add the </ul> tag to the excerpt, to ensure your homepage continues to validate (Not overly important by any means, but it is nice to do).

Both of These Methods Will Publish a Partial RSS Feed

Sadly, Wordpress does not natively support the feature of allowing you to continue publishing full-text feeds, when you use either of these methods. However, you can get around this by installing Ronald Heft's Full Text RSS feed plugin.

And yes, this does mean that Pro Blog Design is returning to full-text feeds! Apologies for sending out partial feeds for the past week or so.

Discussion on This Article

  1. Sly from Slyvisions.com
    August 18th at 5:47 am GMT
    Comment #1

    Nice post. I don't think you really need all those coding though. As long as you set a summary, your excerpts should be fine.

  2. kristarella
    August 18th at 8:40 am GMT
    Comment #2

    Oops, feel free to ignore the last comment I left on your previous post then!

  3. Michael Martin
    August 18th at 12:56 pm GMT
    Comment #3

    Sly - The codes are just way of controlling what is shown, and how. :)

    Kristarella - lol. Thanks for pointing it out anyway. That was a mistake on my part. I never intended on partial feeds!

  4. joseph hollak
    August 18th at 7:48 pm GMT
    Comment #4

    I really appreciate this post.

    Although I already knew about the -more- posting function, I had no idea that the Heft plug existed allowing for full feed posts even if I use the -more- technique.

    I think Heft's plugin is right on and much needed.

    Judging from his post that you link to, the plugin is very popular and well received.

    Now I can offer partial posts on my blog itself and then send out full feeds to my subscribers.

    Thanks again for pointing us in that direction.

    joseph hollak
    http://www.hollakmedia.com

  5. Michael Martin
    August 18th at 7:56 pm GMT
    Comment #5

    No problem Joseph. I agree that the plugin is an absolute necessity. It really amazed me what the excerpts were doing to my RSS feed, and as you said, it seems that many others were amazed by it as well!

    As always with Wordpress, someone saved the day with a plugin. ;)

  6. kristarella
    August 19th at 6:50 am GMT
    Comment #6

    Ooops, I feel even more silly. I started using the more feature and didn't realise that what you've just said in this post applied to it! I've installed Heft's plugin!

  7. subcorpus
    September 1st at 5:26 am GMT
    Comment #7

    where can i find the Heft's plugin ... ?

  8. Michael Martin
    September 1st at 12:52 pm GMT
    Comment #8

    Kristarella - I made the same mistake! It's a slight flaw in Wordpress I think.

    Subcorpus - It's the link at the bottom of the post. Here you go.

  9. Steven Snell
    September 15th at 5:57 pm GMT
    Comment #9

    Michael, do you use method 2?

  10. Michael Martin
    September 15th at 6:12 pm GMT
    Comment #10

    Yep, how'd you know? :)

  11. Andreea
    November 11th at 9:45 am GMT
    Comment #11

    How can I make a full text post in my blog, and return it only with the first 50 words in feed readers ? Please help

  12. Michael Martin
    November 11th at 5:06 pm GMT
    Comment #12

    Andreea - What you're looking for is to use a post excerpt in your feeds. If you use Feedburner on your feed, you can use their "Summarize" option.

    Otherwise, you should check out the Dual Feeds plugin.

    Hope that helps. :)

  13. Andreea
    November 11th at 6:57 pm GMT
    Comment #13

    It helps more than you think. Thank you very much!

  14. Michael Martin
    November 11th at 10:36 pm GMT
    Comment #14

    No problem. :)

  15. Ed
    January 7th at 1:53 pm GMT
    Comment #15

    I have a good solution to this especially if you have too many posts to insert the "more tag" manually.

    Post Teaser - This is a great plugin.

    http://wordpress.org/extend/plugins/post-teaser/

    Ed

  16. Tristan
    May 21st at 10:16 am GMT
    Comment #16

    Hi Michael,

    I am trying to show the first three posts entirely, followed by the next 5 posts with only an excerpt.

    How do you think I can optimise Methode 2 to do that?

    Thankx in advance,

    Tristan

  17. Michael Martin
    May 21st at 1:25 pm GMT
    Comment #17

    Tristan,
    You would need to set up two separate "loops" on the page. One would show your 3 full posts, and the other would show the excerpts of the next 5.

    Have you used the query_posts template tag before?

  18. Tristan
    May 21st at 1:59 pm GMT
    Comment #18

    Thank you for the quick answer.

    No I have never used the query_posts template tag.
    I just tried, and can't manage to make it work...
    I get a blank page.

    Is there another way?
    I can't use the normal loop, can I? ([code]< ?php if (have_posts()) : while (have_posts()) : the_post(); ?>[/code])

    In fact, i'm not even sure that's the best syntaxe for the loop. My theme must be starting to get obsolete...

  19. Michael Martin
    May 21st at 6:30 pm GMT
    Comment #19

    No problem.

    Yep, that's the start of what you would use. In your index file, could you copy and paste everything from the line

    < ?php if (have_posts()) : ?>

    to

    < ?php else : ?>

    Not Found

    Sorry, but you are looking for something that isn't here.

    < ?php include (TEMPLATEPATH . "/searchform.php"); ?>
    < ?php endif; ?>

    (Or email it to me!)

    I'll send you back the code you need then. :)

Leave a Reply