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!

231 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.

  11. Alexis says:

    Hi Brandon,
    I’m trying to move a Rails website over to WordPress, but need to find a daily quote plugin or widget that allows me to have several fields: id, date, quote, author and source. Plus, I need to be able to upload the quotes or import them from a csv file converted from postgres. Do you think your perfect quote will work?

  12. Alexis says:

    You can see the current daily quote on the sidebar here:
    http://www.berkeleytemple.org

  13. brandon says:

    Alexis,
    My plugin is saving all that data (or should be). It has been a while since I looked at the code. But as far as importing all existing quotes, I don’t have any functionality like that. I would look into a plugin that can import csv data for you. Try https://wordpress.org/plugins/wp-ultimate-csv-importer/. You can specify the custom post type as well.

  14. Darren says:

    Hi – awesome plugin!
    For some reason when I use the widget and set random quotes to on it still only pulls the most recently entered/published quotes. Do you what I might be doing wrong? Same thing with shortcode of random=”1″ or “true”.
    thank you for your help.

  15. brandon says:

    Darren,
    What hosting service are you using for your site? There was an issue recently with another user of this plugin and their WordPress hosting platform didn’t allow the random post functionality unless it was specifically enabled.

  16. Darren says:

    Thanks for responding. Im using wp-engine.

  17. brandon says:

    Yeah, this issue came up with another person using this plugin. WP-Engine doesn’t, by default, allow random. You need to explicitly allow this option.

  18. Darren says:

    alright thanks very much for that. will contact them.

  19. Engin Erden says:

    Hi,

    i’m using this plugin , everthing seems ok . But when we press the preview quote button, it shows empty page , however if i search a word from quotes, search result is ok but if i click the read more button , it shows empty page.

    How can we solve the problem or how can i change the permalink for quotes

    Thnks

  20. Bryan says:

    Hi Brandon,

    I am using your plugin on a mostly static homepage. That page gets updated with every new blog post, which is weekly or bi-weekly. I have caching turned on, which means that the random quote, placed via a shortcode on the page is fixed until the next page update, i.e. blog post.

    Would it be possible to add AJAX functionality to the plugin, where the quote gets updated, say every hour/day?

  21. Julie says:

    Hi !
    Excellent plugin ! Thanks !
    I would like to export my quotes database from a website to another. How can i do that ?
    Thanks !

  22. brandon says:

    Bryan,
    You could do that if you want, but I don’t have any intention of adding that kind of functionality to the plugin. You could set your cache to expire every hour or day if you wanted…

  23. brandon says:

    Julie,
    I would recommend using some sort of export plugin. Like https://wordpress.org/plugins/wp-migrate-db/. Or you could use https://wordpress.org/plugins/adminer/ to get into the database itself and export the rows you want. However, all the quotes are saved with other posts and pages and might get a little tricky…

  24. Derek says:

    Hi,
    1. Is there a way I can make the “Enter Perfect Quote Here” box larger to accommodate/edit bigger quotations?
    2. Will you be adding Tags (in addition to Categories) any time soon?
    3. Will you be adding an option to turn off the display of quotation marks around the quote?
    Thank you.
    Derek

  25. brandon says:

    Derek,

    1. Currently the quote is using WordPress’s default title field, so no.
    2. Probably not. I actually haven’t done much development on this plugin in quite a while.
    3. Also, probably not.

    Sorry to be the bearer of bad news, but these days I rarely have time to work on these kinds of things. If someone paid me to do some work on it, I might consider ;)

  26. Heather says:

    Hey Brandon,
    I’ve migrated one blog content to a new blog that will go live soon. For some reason, I don’t know if it’s my theme or the latest version of WordPress, but the “quote author” field doesn’t show up anywhere in my quotes–whether the widget or the shortcode in posts. Any idea why that may be? I LOVE this plugin and if you needed a donation to update it to get it to work in newest WP, I’d be a donor.

    Thanks!
    Heather

  27. Jenny says:

    Hej! I love your plugin, but I would like to change some stuff. Is it ok if I take your code and branch off?

    Changes I want to make:

    Title is a title, not a quote.
    Quote is located in the post content, so when you “get_the_content” you get the quote.

    Widget links to the Quote page and users can comment on the quote.

  28. brandon says:

    Jenny,
    If you would like to fork the code and customize it, feel free!

  29. Jenny says:

    Yay! Happy! Thanks :)

  30. Sanjin says:

    Hi Brandon,

    A few hours I lost looking for an adequate Quotes plugin. I had only two criteria. First, that has categories (I have a page in two languages, work with Polylang) and second to support Eastern European languages. Both work great.

    But I have a problem. I use the widget. Quotes is aligned to the right side. And it looks unnatural. How do I remove the alignment, ie, everything to be on left side. No indentation.

    Is it possible (alignment) built into the plugin?

    Regards

  31. brandon says:

    You can use CSS to take care of all the alignment. You would need to use !important after each declaration. That should fix the issue.

Leave a Reply