
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 (
).
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.
Custom Search
Sly from Slyvisions.com (18 comments)18 August 07
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.
kristarella (141 comments)18 August 07
Oops, feel free to ignore the last comment I left on your previous post then!
Michael Martin (1285 comments)18 August 07
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!
joseph hollak (1 comments)18 August 07
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
Michael Martin (1285 comments)18 August 07
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.
kristarella (141 comments)19 August 07
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!
subcorpus (1 comments)1 September 07
where can i find the Heft’s plugin … ?
Michael Martin (1285 comments)1 September 07
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.
Steven Snell (24 comments)15 September 07
Michael, do you use method 2?
Michael Martin (1285 comments)15 September 07
Yep, how’d you know?
Andreea (2 comments)11 November 07
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
Michael Martin (1285 comments)11 November 07
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.
Andreea (2 comments)11 November 07
It helps more than you think. Thank you very much!
Michael Martin (1285 comments)11 November 07
No problem.
Ed (1 comments)7 January 08
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
Tristan (4 comments)21 May 08
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
Michael Martin (1285 comments)21 May 08
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?
Tristan (4 comments)21 May 08
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…
Michael Martin (1285 comments)21 May 08
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.
fatihturan (1 comments)19 July 08
Hello.
How i can do two different size with two different excerpt size in Wordpress? In example: I want to do first featured post will be 380 character and other posts will be 270 character.
By the way this is my work sample is here: http://www.xhmlmutfagi.com/sinemalardan/
Thanks.
David (15 comments)18 August 08
I have a site that shows thumbnail of images of blogs and I want to show . Does anyone of you know how I could show excerpts of only certain post. So instead of showing excerpts from all post, I would only show excerpts from selected post.
Michael Martin (1285 comments)18 August 08
David,
You would have to use the query_posts template tag to select only the posts you wanted, and then use a normal loop afterwards with the code for showing the excerpts as you want them.
Lorna Kirby (1 comments)13 November 08
d7nzb09ze7bvsdbl
Felipe Santana (1 comments)18 December 08
Muy bueno ….
Alexander Yeh (1 comments)31 December 08
Hi, first of all I would like to show my appreciation for this useful plugin. However the text is right next to the images making it hard to read, wouldn’t it be good on the next update of this plugin to update to add a invisible border of 5 pixels or something? Anyway thanks again for the plugin exactly what I needed.
Ali Hussain (1 comments)9 January 09
Thankyou. This post helped me a lot
Matt (9 comments)15 January 09
Thanks! This helped alot!
Jim Mathieson (1 comments)20 January 09
Thanks, great post. i have now managed to understand both ways of showing an excerpt. New to this wordpress but thanks to this page learning fast.
Jon Julsrud (1 comments)25 February 09
This is a great blog, I stumbled upon it and read five posts before leaving. this post in particular helped a lot. I think I am going to start posting summaries. I have a friend who did there site in blogger though that would also like to post short introducrions to longer psts. Do you know how this is done?
wave (2 comments)6 March 09
Excellent post! Thanks so much. I found this on a search for how to do just this, and then had a real “duh” moment because I’ve been using wordpress off and on for a while now but never noticed the “more” tag option! (doh!)
Looks like a great blog and I will be back to see what else I’m missing that’s right under my nose. Also appreciate the help on the php files and where to find the editing options – thanks!
Political Jive (1 comments)9 April 09
Very helpful article for my columnists who had questions. Saved me a lot of time, thank you!
AJ Farro (1 comments)25 April 09
Thanks for the excerpt tips. OMG, that stupid button on the WordPress tool bar has been starting me in the face for HOW long? Something so blatantly simple. I knew about it at one point and then I completely forgot about it. I feel like an idiot. Couldn’t see the forest for the trees. Now I’ve got to get busy and clean up my blogs. Thanks again.
Dave (15 comments)27 April 09
Thankyou for the info . We can add a code in the index file to show always an excerpt if you always forget to describe an excerpt with these methods
Kathi (1 comments)4 May 09
Hi. Thanks for this great tips. Now I know how to control text display for both my index and archive files. Thanks again.
vicki (1 comments)12 May 09
How do you actually select before you click the more button? Can’t get this to work. Is it the cursor, or do you highlight the text that you want to show before the more button?
vicki’s Latest Post: A Conversation with…Carol Poore
wave (2 comments)12 May 09
Hi Vicki – just use the cursor! Place the cursor after the text you want to show before, and then use the more button to insert the break at that point.
Rob (34 comments)16 May 09
Thanks so much for the insight. I have a small problem though, I have created a centercolumn.php to display the excerpt and when you click on the “READ MORE” it displays the post by itself, but it’s still just an excerpt.
What am i doing wrong?
Deran (1 comments)13 June 09
Thanks a lot for this post. I used this on my blog. Keep up the good work.
Micadz (1 comments)23 June 09
I have followed your instructions under method 2, since I am trying to line up all the posts so that the Continue reading is on the same line for all the posts … but somehow it does not work … my website is http://www.commonpeople.sg/v1/
Mobile (1 comments)30 June 09
Hi!,
I want to show complete post while opening RSS feed of my blog (http://www.cheapmonthlymobile.co.uk/blog/). How can i do that? I already enabled “Full Text” option in reading section, but doesn’t works? Help Me!!!
TechThem (1 comments)8 July 09
Thanks a million
.-= TechThem´s last blog ..Andrea 0.3 Free Wordpress Theme By lucianmarin.com =-.
Jason (5 comments)18 July 09
Great post, helped with what I was looking for.
Cheers!
.-= Jason´s last blog ..Edmonton Worldwide Photo Walk Update =-.
Debajyoti Das (1 comments)16 October 09
I am using feedburner and I have burned the feed with http://www.snaphow.com/feed (I am also using Thumbnail for Excerpts Plugin)
But What Happens is, that they Show the Fullpost in the newsletter….
So I used the Summarize Option to shorten It … But it Removes the Thumbnails.
What I want is to Show a Post Summary with Thumbnail and a Read more Link in the Email Newsletter of Feedburner.
Is is Possible ?
frank katzer (1 comments)17 October 09
i’m wondering how to use the excerpt as a summary in the article page. somebody has an idea about this?
(btw: @problogdesign: you have a perfectly clear blog-design!)
German (2 comments)3 November 09
Thank you very very veryy much!! for the answer. I was looking for the excerpt!.
Muchas gracias amigos!!!
Blogging Tutorials (1 comments)21 November 09
Thank you so much for this helpful post.
mostafahawary (1 comments)20 December 09
Oh fin, I got it …. thanks alot …….
Digitivity | Digital Productivity (1 comments)29 December 09
Thanks for the article.
If you want to count your words, you can type “wc -w” (without quotes) in to a Linux command shell (which is what most web hosts offer).
Then paste the first few paragraphs, hit Enter, then Ctrl+d.
The wc command will report the number of words in your text.
Mitko (12 comments)7 January 10
Thank you very much! I have been trying to figure this out, but never could, maybe because I am new to WP.
Anyways the more function should come with explanatory just like yours so newbies like me understand it better
Mitko (12 comments)7 January 10
May the author answer a question for me, Is it good that the Read More, sends you in the middle of the page where the articles continues?
Or would it be better to show up the whole article from the beginning?
Because the Read More , just does the first!
Melissa (1 comments)13 January 10
Thanks Michael, this provided a quick solution in simple English!!