control your excerpts

Here’s another neat trick which I love, but which was hard to find when I first wanted to use it. Have you ever wanted to show some information on your home page about a page or post, with a sentence or two explaining it, but without that text actually being part of the page? I have, and I’ve shared this enough that I’m going to share it here, too.

If you have a blog page (like mine) with just part of the post content displayed, that is frequently done by setting a content limit (say, 300 characters), and WordPress automagically adds a “Read More” link at the end of the content limit.

The More Tag

use the more tag to control your excerpts
use the more tag to control your excerpts
You can, however, control that. Instead of having a content limit, you can choose instead to show an excerpt, usually 1-2 sentences. You do this by writing your intro text and following it with something called a “more tag” (well, that is what I call it–I don’t know if this is its actual name). In the text editor, it looks like this:

<!--more-->

It’s also a button in either editor so you do not have to remember the fancy code. Here is what the excerpts look like, for example, in a widget on the home page of your website.

Add No Teaser to the More Tag

the more tag with no teaser
the more tag with no teaser
What if you want your excerpt to say one thing, but you don’t want it to be at the top of the page or post? You can modify your “more tag” by adding one more tag to it:

<!--more--><!--noteaser-->

If you add the “no teaser” tag to your “more tag”, your excerpt can say whatever you need it to, and it will be hidden from the actual page content. This comes in handy if your opening sentences are not as concise as you need for your widget on your homepage or your sidebar to be.

Sometimes, it doesn’t matter if you use an excerpt. When it matters, though, it can really make an impact–and when it really matters, you can really fine tune your excerpt with the “no teaser” tag.

Thanks, Rabia, for reminding me to share this tidbit!

Do something awesome. Tell a friend:

subscribe by email

If you're an email kind of person, that's totally cool. Go ahead and sign up here to get the latest blog entries in your inbox! No worries, I never share your address.
  • This field is for validation purposes and should be left unchanged.

Reader Interactions

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Bars Code Check chevron-down chevron-left chevron-right chevron-up Envelope Laptop Search Times Facebook GitHub Google Plus Instagram LinkedIn Pinterest Twitter WordPress Logo Wordpress Simple