noteaser – The unknown WordPress tag

noteaserMost WordPress users will know the <!--more--> tag which allows you to create a teaser for your blog post. The text in front of the tag will be displayed on the main blog page and after clicking the “more” link the single post page containing the teaser and remaining part of the blog post will be displayed.

More often than not this is adequate but there may be situation where you want to create a separate teaser which isn’t displayed on the single post page. So it may be a good idea to create a collage as the teaser for a post containing various images. On the post page itself the collage would not be appropriate. Another situation could be a very striking teaser which does not fit into the main post but still is a good teaser to attract readers.

To hide these parts of the post you can use the lesser known <!--noteaser--> tag:

Teaser text
Post text.

The <!--noteaser--> necessarily has to follow directly after the <!--more--> tag otherwise it will not be evaluated.

However there are some issues using the tag:

  • After clicking the more tag the content of the post will be moved to the top of the browser window. This may be appropriate for a standard posting where the teaser text shall be hidden from the reader’s eyes. Using the noteaser tag there is no such text any more and the reader is wondering if there is anything above.
  • The text in front of the <!--more--><!--noteaser--> tags will not be shown on the preview page. So you have to write your post in two steps: first creating the text as usual and inserting the <!--noteaser--&gt in the final state.
  • All line breaks are preserved. To avoid an additional empty line at the top of the post you should insert the tags on a single line.

These issues may be solved by creating a plugin… maybe later. Nevertheless the tag is a nice tool to add a different view to your blog.


Comments

10 responses to “noteaser – The unknown WordPress tag”

  1. […] A note on the “teaser text”: Did you know that there’s a tag, <!–noteaser–>, to make the content before <!–more–> a “teaser text” and not show that part in the single post page even if $strip_teaser is set to FALSE? I certainly did not! It’s not completely unknown, though—here’s a post from 2009. […]

  2. […] A note on the “teaser text”: Did you know that there’s a tag, <!–noteaser–>, to make the content before <!–more–> a “teaser text” and not show that part in the single post page even if $strip_teaser is set to FALSE? I certainly did not! It’s not completely unknown, though—here’s a post from 2009. […]

  3. […] A note on the “teaser text”: Did you know that there’s a tag, <!–noteaser–>, to make the content before <!–more–> a “teaser text” and not show that part in the single post page even if $strip_teaser is set to FALSE? I certainly did not! It’s not completely unknown, though—here’s a post from 2009. […]

  4. […] A note on the "teaser text": Did you know that there's a tag, <!–noteaser–>, to make the content before <!–more–> a "teaser text" and not show that part in the single post page even if $strip_teaser is set to FALSE? I certainly did not! It's not completely unknown, though—here's a post from 2009. […]

  5. […] a “teaser text” and not show that part in the single post page even if $strip_teaser is set to FALSE? I certainly did not! It’s not completely unknown, though—here’s a post from 2009. […]

  6. […] A note on the “teaser text”: Did you know that there’s a tag, <!–noteaser–>, to make the content before <!–more–> a “teaser text” and not show that part in the single post page even if $ strip_teaser is set to FALSE? I certainly did not! It’s not completely unknown, though—here’s a post from 2009. […]

  7. […] A note on the “teaser text”: Did you know that there’s a tag, <!–noteaser–>, to make the content before <!–more–> a “teaser text” and not show that part in the single post page even if $strip_teaser is set to FALSE? I certainly did not! It’s not completely unknown, though—here’s a post from 2009. […]

  8. […] A note on the “teaser text”: Did you know that there’s a tag, <!–noteaser–>, to make the content before <!–more–> a “teaser text” and not show that part in the single post page even if $strip_teaser is set to FALSE? I certainly did not! It’s not completely unknown, though—here’s a post from 2009. […]

  9. […] A note on the “teaser text”: Did you know that there’s a tag, <!–noteaser–>, to make the content before <!–more–> a “teaser text” and not show that part in the single post page even if $strip_teaser is set to FALSE? I certainly did not! It’s not completely unknown, though—here’s a post from 2009. […]

Leave a Reply

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