Print This Post Print This Post
May 31

This quick and dirty trick shows EITHER

  1. the text you entered in the EXCERPT field when you added the post in the first place, OR
  2. only the first 55 words of the post.

Unfortunately, it doesn’t want to put the LINK there…

For this example, you need to CAREFULLY change the previous bit of code to :

<div class="entry">
<?php the_excerpt('Read the rest of this entry »'); ?>
</div>

Just change the_content to the_excerpt – do it now, and hit the UPDATE FILE button.

The EXCERPT field is an interesting one to play with as it can contain text that is different to your main “message”. The excerpt text is displayed

  • on the home page if you use the <?php the_excerpt(); ?> template tag as described above,
  • in your RSS feed

HINT: It might be worth “playing” with the excerpt field if you want to include an introduction that might be a little more keyword relevant and/or customer enticing than the introductory 55 words of your post.

In the case of THIS post… my EXCERPT field contains:
“A couple of easy changes anyone can make to WordPress to show SUMMARIES of recent posts on your home page instead of the full post.” and that’s what people will see on the home/archive/category page as well as in my RSS feeds.

Other template tag variations allow you to change the number of words, and the “more” message to accompany the link. These are usually found as additional FUNCTIONS in some of the template files you may download.

If you use them without the available functions, you’ll get an error.

As soon as I can find a nice template that I like, that’s the way I’ll be doing it here and on my other sites. And if the template doesn’t include that function, then I’ll be “borrowing” it from another one that does!

Until then, I prefer to stick with the <?php the_excerpt('Read the rest of this entry »'); ?> variation above.

But wait… there’s more…

If you like this post, buy me a coffee

Popularity: 35% [?]

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blogmarks
  • Furl
  • Netscape
  • NewsVine
  • Reddit
  • scuttle
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb

Pages: 1 2 3 4

One Response to “Show Summaries of Recent Posts on Home Page”

  1. A Place For Stephen » Blog Archive » Theme Switcher Plugin Says:

    [...] For example, with the WordPress Classic theme I tried to include the_excerpt tag on the main index page to show summaries of the posts on the home page. [...]

Leave a Reply