How to Display Random Quotes in Your WordPress Sidebar
Quotes are an excellent example of how powerful words can be. When used properly, they can be that tiny detail that makes a huge difference and keeps a user coming back. Sometimes their power lies in the perfect combination of words and other times it is more about who said those words that produces the effect. Finding a quote that perfectly reflects the idea behind your website is a great way to add value to your brand and create the desired atmosphere on your pages.
Apart from the common use of quotes in articles, the sidebar can also be an excellent location for quotes. You can choose one powerful quote or select a few that you feel resonate with you the most and set them to show randomly in your sidebar. This way you provide a richer user experience, visitors feel like there is more to your website and they are intrigued to explore your pages.
This is precisely what we want to talk about in this article and show you how to easily display random quotes. We are sure you can come up with some great ideas on how to use quotes on your website effectively, and in this article, we will show you how to display random quotes in your sidebar, or in your post/page with a plugin. Read on to find out about:
Quotes Collection is a great free plugin, trusted by more than 10.000 active users. It is a robust and easy-to-use tool with stellar ratings, that allows you to display and collect quotes on your WordPress website. With this plugin, you can show quotes in any available widget area.
The main advantage of the Quotes Collection plugin is that it allows you to create your own collection of quotes and provide a more personalized user experience while most other plugins of this type usually let you display quotes from popular quotes websites. The thing is, quotes added to your website from another website usually link back to that other website which is of no use to you, plus it can even drive your audience away from your pages.
Installing the Quotes Collection Plugin
The Quotes Collection plugin is installed just like any other WordPress plugin so we are not going to dive into installation details. In case you need some assistance, make sure to check out our tutorial on how to install a WordPress plugin.
After the installation, you will see the new Quotes Collection tab in your WordPress admin panel menu.
Creating Your Quotes Collection
Before you set everything to display quotes randomly on your site, you need to actually create a collection of them. After picking the quotes that you believe will be most effective for your website, go to Quotes Collection » Add New page to add the desired quotes. Each quote will have its own “page” in the backend, much like product singles in a WooCommerce shop.
In the menu on this page, you will see several fields. Enter the quote in the first field. The following fields are optional, you can but don’t have to enter the quote author’s name, mention the source and add a tag. The Public box is checked by default, in case you uncheck it the quote will only be saved as a draft.
Repeat the procedure for every quote that you want to add. We added three quotes. To check how your collection looks like, go to All Quotes page. They will be arranged in the order you entered them:
This is also the page where you can Edit / Delete your quotes.
Setting the Quotes Collection Options
To adjust the plugin settings, go to Quotes Collection » Options page. This is where you can set the number of iterations to load on refresh. The last option ‘Dynamically fetch the first random quote in widget’ will help you in case your cache plugin causes your website to display the same quote to visitors – if this happens, make sure to check this option. After you adjust the settings, click the Update Options button.
Displaying Random Quotes In Your WordPress Sidebar
The next step is to display random quotes on your website. Specifically, today we’re interested in displaying quotes in the sidebar. The easiest and most straightforward way to do it is to use the plugin’s built-in widget and add it to the sidebar widget area.
Go to the Appearance » Widgets page in your WordPress admin panel. Look at the list of available widgets and you will notice the new Random Quote widget. All there is to do now is to drag and drop the widget to the sidebar where you want to display your quotes.
But before you do that, you may want to change the title that will show above the quote section. The default title in the Title field is “Random Quotes”. Simply enter the title you want. In our case we changed it to “Daily Dose of Inspiration”:
There are more settings you may want to adjust. For example, the default setting is to show widgets randomly, but you can also change this if you want to. Click on the Advanced options to access more detailed settings:
You can set your own refresh time, so that a different quote is displayed every 5 seconds, for example. You can set any time you want here.
If you entered the quote tags, you can also set the tag filter, to display only inspirational quotes or any other tag that you created. After you have adjusted all the settings, remember to click Done.
Now, you can go and check how the quotes look like in your sidebar.
As we mentioned, you can add quotes as widgets to any widget area on your pages. This is how it looks like when added to the footer area:
If you want to display your random quotes within the page itself, or in a post, you can do so using a shortcode you get with the plugin.
All you need to do is to add this shortcode to a post or page where you want the quote to be displayed:
[quotcoll]
Notice that the quotes added this way will be displayed in a form of a plain list.
But, there is a way to set the quotes to reiterate randomly, simply by setting specific parameters in the shortcode. So, to display a random quote that will automatically refresh every five seconds, use:
[quotcoll ajax_refresh=true]
There is a variety of parameters you can use to control how the quotes will be displayed in the post/page.
For example, the shortcode:
[quotcoll tags="inspirational,motivational,life"]
will display quotes tagged with tags “inspirational”, “motivational”, and “life”.
To see the complete list of possible parameters, visit the plugin’s documentation page.
The plugin also adds two blocks to the Block Editor:
Once you decide on a post or page you want to add your quotes to, you will have two choices. You can add a list of all quotes to the post by adding the Quote block, or if you want the quotes to reiterate randomly you can simply add the Random Quote block to the post, and all the quotes from the quotes collection you made will reiterate every five seconds.
Wrapping It All Up
Thanks to the Quotes Collection plugin, you can now finally have your own set of randomly displaying quotes right there on your pages, without linking back to other websites. This collection can be anything from just a couple to dozens of quotes, as long as you are sure they work to your advantage. Adding inspirational quotes to a website and social media has been a huge trend for a long time now, so you have to be careful when choosing the quotes to display on your pages. Make sure they truly reflect your values and that they are not overly used or they could have the opposite of the intended effect.