Custom Post Excerpts in WordPress

A reader contacted me this weekend and asked how I got my excerpts on the homepage to look the way they do. So I thought I would share my secret with everyone.

If you have chosen to go with a blog homepage that contains excerpts instead of full posts, this tip will help make them look a lot better .

What’s So Bad About The Default Excerpts?

By default, WordPress takes the first 100 characters of your post and uses them as the post excerpt. As far as length, this might be fine depending on how long your posts are. The problem, is with the formatting. Take a look at this excerpt:


Notice how all of the formatting has disappeared within the post? It simply takes all the words and places them together. This is a problem if you use a lot of formatting, such as H2 subtitles.

Another major downfall is that it does not use any images that may have been contained in your post. It ignored them completely. This can make your homepage look really boring since all of your excerpts will be text-only.

How Should They Look?

Now, here is an example of how excerpts should look. Take a look at this screen shot of an excerpt from my old homepage:

Doesn’t that look a million times better? I sure think it does. It gives the reader much more to look at then simple text. It retains the text formatting and also gives the option to include images.

What’s The Secret?

The key to making them look better, is utilizing the optional excerpt feature built into WordPress. If you don’t know what I am talking about, it can be found below the post on the write/manage pages and looks like this:

All you need to is place the information you want to be included in the excerpt. The secret is to switch to HTML view before you copy the part you want to include. Therefore, all of code is copied over. If you simply copy the post from view mode, it will only place the text in the excerpt which looks the same as the default view.

So give this a shot and let me know how it works out for you.

11 thoughts on “Custom Post Excerpts in WordPress

  1. Justin Post author

    I used to show my whole posts in my feed, but then I noticed a few crappy spam sites were posting all of my articles in full. So I decided to go with excerpts so the worst thing they could do it paste a summary on their blog.

    Reply
  2. Jeremy Gehrs

    Excerpts seem like a great way to reclaim some valuable screen real estate. Thanks for the good post, I’ll be trying this, but how do you enable excerpts in the first place in wordpress?

    Reply
  3. Justin Post author

    @ Jeremy: I believe you can change the setting on the reading tab of the settings menu. They might have taken it away from the new WordPress. I am using the “Homepage Excerpts” plugin for WordPress that allows you to set them up and define how many posts to show on the homepage.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>