Perfect Quotes – a WordPress plugin

Recently a family member asked me to help set up a WordPress site so they could start blogging and share with the world their thoughts about life. One of the things requested was a plugin that would allow them to put a quote they liked onto the sidebar. It seemed like a simple enough request. So I headed off to wordpress.org to look at their vast plugin library.

What started out as a simple plugin request, turned out to be somewhat of a disheartening dead end. Don’t get me wrong; there are tons of quote plugins out there. I just wasn’t able to find anything that was simple and straight forward.

Most of the plugins pulled quotes from external websites and displayed random quotes. Others were poorly written and confusing to implement, much less use. Here is what I wanted: to enter whatever quote I want, to add an author or source of the quote, and to show that quote where I want, when I want, and how I want. And then I had a thought, “I’ll just make it myself!”. And Perfect Quotes was born.

About Perfect Quotes

Perfect Quotes is a simple plugin designed to do only one thing: to display your quote where you want it, nothing more, nothing less. It is built around custom post types, which allows every quote you ever have added to be archived in the WordPress database. You’ll never wish you could remember that one quote, it’s still there! It has a widget function, so you can put the quotes on the sidebar of your site, or maybe the footer. It also has a shortcode which allows you to place whichever quote you want into and blog post or page you want! Let’s get started and put your quotes onto your site!

Perfect Quote Plugin Installation

The easiest way is to navigate in your WordPress admin area to Plugins > Add New. In the plugin search bar type in “Perfect Quotes” and press enter. Once you locate the plugin, install it. It will automatically download the plugin into your WordPress application. When it is complete, click Activate Plugin and your on your way!

How to write a Perfect Quote

You will notice a new menu at the bottom of the left hand menu that looks like this

Click on Add new and you will be taken to a new page where you can add your quote. Type in your new quote like this:

If you want to add an author or source for you quote you will need to use what is called a custom field. In the Name field type in “perfect_quote_author”. And in the Value field type in the name of the author or source. Then click Add Custom Field. Enter the info like this:

Once that is complete we are ready to save the quote. You can also have this post publish at a later date if you so choose, or you can save it as a draft. Your choice. Whatever you choose, click either the Save Draft button or the Publish button when you are done.

You have now entered your first quote. I am sure it won’t be your last!

The Perfect Quotes Widget

If you want to add the widget to your sidebar or other area on your site, follow the instructions here to accomplish just that. First you will want to navigate to the Widgets area. Look at this menu to see what I mean:

Once in the the Widgets area, drag the Perfect Quotes widget from the main area to the sidebar or area of you choice. For this example, I dragged it to the Main Sidebar.

After you have placed it in the area you chose, click the down arrow on the right side of the widget to show a few options. You can give it a title of your choice. If you leave it blank, it will default to Perfect Quotes.Here you can see I chose to title mine My Quotes. You can also enter how many quotes you want displayed at a time. The default for this is only one quote. Keep in mind, that this widget will always grab the newest quote first and work its way back. Then click Save and go view your site!

Here is what the finished Perfect Quotes widget looks like on the site.

Perfect Quotes Shortcode

What is a shortcode you might ask? It is a simple “code” or set of instructions that WordPress understands and which tells WordPress to do something. In this case, we are going to tell WordPress to grab a particular quote so we can show it in a post or on a page.

It is really quite simple. On the Perfect Quotes custom post overview page, find the quote you are looking for. Then locate the column title Shortcode and copy the corresponding short code. It should look something like [perfect_quotes id="54"].

 

Once you have copied this, take it over to the post or page of your choice, or add a new post or page, then paste the shortcode where you would like it to appear.

 

Then Update or Publish your post or page, and go view it to see how it looks!

Congratulations! That’s all there is to it! Happy Perfect Quoting!

210 Responses to “Perfect Quotes – a WordPress plugin”

  1. brandon says:

    Steve, to be honest, I have never heard of that issue and I’m not sure why it is doing that. Can you post the shortcode that you are using?

  2. Steve says:

    Brandon, thanks for replying so quickly.

    Shortcode: [perfect_quotes num="1" random="true" cat="2"]

    It works just fine while I’m logged in to WordPress, but if I access from iPhone or iPad or a non-logged in browser, I get just one quote that doesn’t change – but sometimes it will serve a few quotes first before stopping. For example, my iPhone stuck on one quote straight away, a non-logged-in Safari window on the Mac served up four or five before getting stuck and my iPad was logged in to WordPress and working fine – a new quote on every refresh, so I logged out and it stuck straight away.

    I thought at first it was an iOS problem or something to do with the responsive theme (‘twentythirteen’ – came free with my Hostgator install) but neither of those can be right (I get the same problem on another one of my sites that uses a Themetrust theme).

    I’m using the latest update of WordPress 3.9.2

  3. brandon says:

    Steve,
    Are you using some sort of caching plugin within WordPress. If so, it sounds like a potential issue is that a normal user is forced to use cache files, whereas an admin isn’t using caching.

  4. Steve says:

    Hi,

    I was just looking at that. WP Super Cache is enabled by default with the Hostgator install. I was trying to figure out if it was actually caching any pages (file info said it wasn’t) and deleted the cache anyway – it hasn’t helped. I’m going to turn it off and see if that does anything…

    After turning off WP Super Cache the iPhone site has started working exactly as intended but the iPad and Safari are still stuck. I’ve force refreshed Safari a couple of times as well. It must be something to do with the cache, but it’s hard to figure.

  5. Steve says:

    Additional info: I’ve turned WP Super Cache off on the other site I’d installed Perfect Quotes (slabscape.com). It was having exactly the same problem before but it’s working fine on all three devices now. It must be that. I suspect that there is a second tier of caching through my hosting service because I had a very weird occurrence when I was designing a site last week and it was serving up deleted images – and different ones to different devices! I’ll leave it for an hour and see if it clears.

  6. brandon says:

    Caching can throw odd/unintended results. One of the things that may still be going on is when caching gets turned on it sets the headers to tell browsers to not look for any page changes until the page expires which could be two weeks from now. This has always been a really big issue with anything Internet Explorer. Just be patient, keep hard refreshing, until you can finally see the changes.

  7. Steve says:

    Update – fixed. There’s a ‘Delete Expired’ button in WP Super Cache settings. That got the other platforms working. I’ve no idea why the iPhone started working before the iPad, but life’s too short to bother finding out.

    So the lesson seems to be: ‘Don’t use WP Super Cache with Perfect Quotes’. In fact, it’s probably usable if you understand how to tweak the 17 advanced settings correctly. See above re life expectancy priorities.

    Thanks for your prompt help. You should have a tip-jar or similar.

  8. brandon says:

    Yeah, there are way to many caching options and they are all confusing. You could load those via javascript which would bypass the caching mechanism, but then that is confusing as well. I’m glad you got it figured out! Happy quoting!

  9. Val says:

    Hi Brandon, awesome plugin!! Can you tell me if there is some way for me to edit the code to make the dash that appears to the left of the author’s name in the shortcode single quote version to an em dash? Example:

    - (your dash)

    — (dash I want)

    Thank you so much!

  10. brandon says:

    Val,
    You would have to alter the plugin files.

Leave a Reply