WordPress Plugin: Graceful Pull-Quotes

What is it?

The Graceful Pull-Quotes plugin (formerly “JavaScript Pull-Quotes”) is an add-on for WordPress that allows you to easily insert pull-quotes into your posts and pages. It uses client-side JavaScript specifically because, as a purely visual effect, it seems appropriate to avoid “doubling up” the text for people on text-only browsers or older browser that probably won’t properly handle the CSS involved. If a browser has JavaScript turned off, or otherwise somehow can’t handle the pull-quotes, then they should be completely invisible and out of the way.

How do I use it?

The plugin will look for any text that is inside a tag with a class of “pullquote”, and turn it into a pull-quote. <span class="pullquote">This sentence is a pull-quote, for example</span> — though in a real post the span tags will not be visible to readers as they are in this case! Via separate plugin you can add an automatic “Pull-quote” button to the post editor screen (see “extras” in the download); otherwise you should be able to add the <span> manually.

If you like, you can specify a particular side for a particular quote. To do this, simply set the span’s class to “pullquote pqRight” or “pullquote pqLeft”. This will put that one pull-quote on the chosen side completely independently of any other side-related options in use.

There is a Settings panel in the WordPress admin screen that allows you to set various options. I recommend you check it out before adding any pull-quotes to posts — you can find it under the Appearance section.

In the aforementioned settings panel there is a control to select a Style for pull-quotes, much like selecting a Theme in WordPress. There is also a preview button, so you can see what a particular style looks like without having to activate it first.

Sometimes you have a sentence with some subsidiary clause that you don’t want to include in the pull-quote. We’ve got you covered. If you have some text that you want to quote, but leave out extraneous, repetitious, or just plain unnecessary text, you put the alternate text in an <!-- HTML comment --> immediately inside the span. This last part is important — <span class="pullquote"><!-- You can put any alternate text you want in the comment -->the comment must be the very first thing inside the span</span>: no spaces, quote marks, or anything else comes first. (Again, the spans and comments will not be visible to your readers — this is just for demonstration purposes!).

Using alternate text in this way is of course completely optional If you like to keep things simple, just put the quotable text in a span as noted above and you’ll be fine. That’s about all there is to it.

Features

  • The plugin is fully language-aware and ready for localization. German (Thanks Mattias), French (Merci Ben), Persian, and Italian localizations are included.
  • Styles menu. The Options panel has a drop down menu that allows you to choose a visual style for your pull-quotes. Styles are easily customized and open for third-party contributions (similar to WordPress Themes).
  • Preview styles without activating them
  • A pull-quote style can be embedded in a WordPress theme. If the active theme has a file called “jspullquotes.css” in it, that will be used automatically.
  • You can specify a side for a particular quote. To use, set span class to “pullquote pqRight” or “pullquote pqLeft”
  • Successive pull-quotes can alternate sides
  • Optionally strips links out of the quote text
  • Have pull-quotes that differ from the “auto-quoted” text
  • Allow user to choose default side
  • Advanced options to specify the HTML tag and CSS classes to be used

Installation

Download the file, unzip it, and put the jspullquotes folder into your blog’s wp-content/plugins/ directory. Next activate it in the WordPress Plugins panel.

Download

  • This plugin can now be downloaded from the official WordPress Extend depository, so get it there: Graceful Pull-Quotes Plugin.
  • If you’re still using a version of WordPress earlier than v2.5 (which I don’t recommend) you can use this: jspullquotes.zip v. 1.7 (for WP versions lower than 2.5)

Is this download worth something to you? If you have found this system useful, please consider making a donation. Even as little as a dollar is appreciated:





Comments and suggestions are welcome.

Share the Love

If you like this plugin, please spread the word! I’ve made one o’ them handy sidebar link images that you can download and put on your own blog. Please link it to this page, of course! Here’s the image; just right-click and save:

JS Pull-Quotes

Or, if you have the plugin installed, you can simply paste the following into your sidebar (you may need to change the image “src” path, depending on your site):

<a href="http://striderweb.com/nerdaphernalia/features/wp-javascript-pull-quotes/"><img src="/wp-content/plugins/graceful-pull-quotes/extras/jspullquotes.png" alt="Graceful Pull-Quotes" title="Graceful Pull-Quotes" height="15" width="80" /></a>

Acknowledgements

Thanks to Roger Johansson and “Viper007Bond” for laying much of the groundwork that led to this plugin. See the readme.txt file included with the download for further details.

Thanks to Mattias for the German translation, Ben for the French, and to my wife’s friend Toni’s cousin Ralph for the Italian.

Last but not least, thanks to the fine folks at WordPress who made this all possible.

Troubleshooting/ Work-Arounds

  • If you want to use this effect on a non-WordPress website, I suggest you check out the original script on Roger’s site, or my “no links” version.
  • PROBLEM: You install it and nothing happens when you add the span tags to your post. SOLUTION: It may be your theme. Check in the header.php file — the following line must appear somewhere in the section of your page (usually toward the end):

    <?php wp_head(); ?>

  • BUG: There are issues with accented letters within alternate text comments that need to be fixed
  • You may have noticed “alternate text” pull-quotes throwing errors when you have a double-dash in them. This is an obscure technicality of HTML rearing its head. Technically speaking, a double-dash ends an HTML comment, and that means the comment is ending earlier than you want it to.
  • There is a bug in the JavaScript rendering of certain less common browsers, (such as older versions of Safari), which causes it to miss the alternate text. Assuming that some of your users probably do use these browser, you have two options:
    • Do the alternate text as described. The buggy browsers will show the *actual* text in the span as though the alternate were not there.
    • Put the comment alone in a pullquote span, just before the sentence you’re (sort of) quoting. Buggy browsers will not show any pullquote, but other browsers will work normally. Example: <span class="pullquote"><!-- Darn that browser! --></span>Darn that JavaScript-mangling browser!

255 Responses to WordPress Plugin: Graceful Pull-Quotes

  1. Stephen R says:

    To those experiencing crashes — I have no idea what could be causing this. Perhaps some weird conflict with a particular theme?

    I’ll keep an eye out for possible causes, but the JavaScript is pretty straightforward and I can’t imagine how it would cause your whole browser to freeze.

    One thing to test: Does it happen if you use no other plugins, and the default WordPress theme?

  2. Kas says:

    Hi,

    I really love your plugin.

    I am not a technical person and wanted to know how can i show the quotes in colour.

    would be obliged for your help.

    Thanks

    Kas

  3. Animesh says:

    Irrespective of what I do, pullquotes always show on the right side. Don’t know why :(

  4. MEP Project says:

    If I deactivate the plugin, its still works. If I activate it, I get duplicate pullquotes.

    • Stephen R says:

      Hi. The plugin used to be called “Javascript Pull-Quotes”, then was changed to “Graceful Pull-Quotes”. Along with the name change, the directory and file name also changed. It’s possible you have both versions running simultaneously. That’s the first thing I would check.

  5. Lisa Cole says:

    Hi – it’s a beautiful plugin but it’s leaving the original text in place as well as pulling it out. Have I missed something?

    • Stephen R says:

      That’s what it’s supposed to do. A pull-quote pulls a quote from the body of the text. You can however use the HTML comment trick for alternate text if you want a stand-alone pull quote unconnected to the article text.

  6. I’ve seen sites that use pull quotes to bring attention to the most important parts of their content. Many top publishers are doing that.

  7. Anthony says:

    I’m attempting to implement this on a WordPress 3.8.1 installation by applying it to a sidebar via the text widget, however the quote is being duplicated. Is there a workaround for this?

  8. Will says:

    I can’t get pull quotes to work at all. I suspect the theme is overiding it. Do I need to do anything special other I have the sixteen-nine theme. Any help is appreciated.

    • Stephen R says:

      Will — First thing to test is to temporarily switch to the default theme. If pull-quotes do work on the default theme then you will have confirmed that it’s your theme causing the problem. If pull-quotes DON’T work on the default theme, then the problem is somewhere else.

  9. Milton Dixon says:

    Just a heads up for users: Using the plugin with W3 Total Cache, the JS minify setting “Non-blocking using JS” prevents the plugin from working. Using the other non-blocking settings is fine though.

  10. Hi, pull-quote is not appearing in my editor so while I’m writting ther is no way I can use it. There is no button for it on my screen. thank you

Leave a Reply

Your email address will not be published.

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>