PHPMatters Help You Better Hosting Your PHP-based Sites
How to Display Rotating Quotes in WordPress Sidebar

How to Display Rotating Quotes in WordPress Sidebar

The website sidebar is a perfect place to showcase any information you want, such as the advertisements, testimonials, images, the latest updated posts, editor’s picks, search box and many more. This time, we’d like to tell you how to showcase your favorite quotations in this special area via a random and rotating manner.

To be frank, the display of some inspiring quotes not only can reflect your personality to some degree, but also can give some encouragement, power and momentum to your readers. In this case, if you are looking to add some of these meaningful sentences on your site, you can check the below simple tutorial about how to display rotating quotes in WordPress sidebar.

Step 1 – Install the Quotes Collection Plugin

To achieve this goal, the easiest method is to utilize the Quotes Collection plugin. This plugin is powered by an Ajax-based widget that can help you gather, manage and showcase your inspiring quotes in the sidebar area of your WordPress site.

Upon the installation and activation via your WordPress admin, you can find a Quotes Collection tab displayed on your back-end menu bar. Simply click it and press the button of Options for doing some configurations.

Here, you only need to decide three aspects.

  • First of all, you can choose to change the text of the refreshing link for displaying different quotes to your readers.
  • Then, you can determine the maximum number of repetition for the auto-refresh of your quotes. Note that the default number is 20.
  • It is possible that you have installed the caching plugin on your site for better loading speed. In this case, you’d better check the box to enable the dynamical fetching for the first quote. This way, your quote widget will not always display the same quote as the initial showcase.

Quotes Collection Options

Step 2 – Add Your Favorite Quotes

Now, you can start adding your preferred quotes into your website. To do this, you simply need to click the Add New button from the drop-down menu.

Here, you firstly should enter the right sentences of your favorite quotation. If you want to mention the author and the source of the added quote, you can optionally fill out these two black spaces. In addition, this plugin allows you to add some tags to your quotes. This is a great option that allows you to fetch these quotes based on the added tags in the later stage.

Lastly, you need to remember to check the box of “Public”. If you forget to do so, the quote will be saved as a draft and will not be displayed in your website sidebar automatically.

Add Your Favorite Quotes

Note that you can repeat these steps to add as many quotes as you want. In addition, you can click the All Quotes button to check, edit and delete your currently existing quotations.

All Quotes

Step 3 – Display Your Added Quotes

As for the display of these newly added quotes, you can leverage the default widget of this plugin. Here, you simply need to navigate to the Appearance of your dashboard and click the Widgets button. From the widget list, you can find the Random Quote one. Now, you should add this widget to your website sidebar. Note that you can drag and drop it to decide a proper location for the display of your quotes.

Random Quote Widget

Now, you can decide the title of this widget and determine whether to show the quote author and information source in the sidebar. In addition, you can enable the random refresh feature, which will rotate your quotes in a random order. Or, you can choose to display the quotes in the order added. The last added quote will be showcased in the first place. Here, do not forget to decide the refresh frequency based on seconds.

Even, you can choose to utilize the Tag Filter to show the quotes based on the tags you have added. If you want, you can also limit the number of characters for each quote.

The quotes will be displayed like this.

Quotes in Sidebar

In addition to the widget, you can also leverage the shortcode of this plugin to showcase your added quotes in a post or a page.

Quotes Collection Shortcode

However, instead of showing in a random and rotating manner, this method can only display your quotes in a simple list, without the Ajax refresh effect. However, you can utilize some parameters to decide how these quotes will be showcased. For instance, the “author” parameter allows you to show quotes written by somebody; the “tags” parameter helps you display the quotes that have some specific tags; the “orderby” decides the listing order of these quotes; the “paging” and “limit_per_page” parameters decide how many quotes can be listed on a single page.

Quotes List

Special Note of This Plugin

This plugin has a special Import & Export feature, with which you can transfer your quotes collection from one site to another. To do this, you can follow the below simple steps.

  • Go to the Export section from the Quotes Collection tab.
  • Press the Export button to download a JSON file that contains all your quotes. Save it on your local machine.
  • Go to the Import section from the Quotes Collection tab.
  • Choose the right JSON file from your Download folder and press the Import button.