Chapter Quotes for WordPress Posts Revisited

chapter quotesA few months ago, I wrote a post about adding chapter quotes to your WordPress posts. Here I’ll show you another way to add them to posts without them showing up outside of the single-post page, and this method doesn’t require any changes to your theme files.

Last week, I released a WordPress plugin called Conditional Shortcodes. The plugin gives you shortcodes to let you include or exclude parts of you post depending on the context in which it is being shown.

You see it coming, right? Yes, there is a shortcode for including things only when just a single post is being shown. It is the [is_single] shortcode and you could use it for chapter quotes like so:

[if_single]
<div class="startingquote">
  <div class="startingquotetext">Don't tell me what I can't do!</div>
  <div class="startingquotesource">John Locke</div>
</div>
[/if_single]

Add in the css discussed in the other post, and you’ve got chapter quotes that only appear when showing single posts. No theme modification. No custom fields. Much easier, no?

Related Posts

  • Conditional Shortcodes WordPress Plugin
    BlueHostDreamHostGoDaddyJustHost Conditional Shortcodes is a WordPress plugin that gives the power of conditional tags to the people writing and editing the content. As theme desig...
  • Adding Chapter Quotes to Your WordPress Posts
    You know how some books have little quasi-relevant quotes at the start of each chapter? They are called chapter quotes and then can be a nice addition to some posts. Let's see how we can do this eas...
  • The Custom Rel WordPress Plugin
    BlueHostDreamHostGoDaddyJustHost Starting with version 2.8, WordPress automatically puts relational link tags in the heads of posts. This is not a bad thing at all. Not only are they st...

Leave a Reply

HostMonster for Great Unlimited Web Hosting Hundreds of template and themes from $35