Latest version: 2.0.3 (Updated on 29 April 2015 (changelog))
Quotes Collection plugin for WordPress helps you collect, manage and display your favourite quotes in your WordPress blog/website. A random quote can be displayed in the sidebar (or any other widget area) using the ‘Random Quote’ sidebar widget. The widget comes with a cool refresh feature — you will be able to get another random quote on the same space without refreshing the web page. All quotes or a set of quotes can be displayed in a WordPress page by placing a shortcode
[quotcoll] in the desired page. Also available, the template function
quotescollection_quote() that can be directly coded into a template file, and a random quote will appear in the corresponding location in the output.
The plugin is similar, and uses ideas from (though not based on) the old wp quotes plugin by Dustin Barnes.
Table of contents
- Frequently Asked Questions
- Feedback & Support
Click on the thumbnail for the larger image.
You can find a live demo of the ‘Random Quote’ widget at the sidebar here!
Development can be followed at GitHub.
Released for free under the GPL.
- Go to Plugins -> Add New in your WordPress admin area
- Type ‘quotes collection’ in the search box available and hit the ‘Enter’ key
- Locate the ‘Quotes Collection’ plugin authored by Srini G, and click ‘Install Now’
- Dowload the latest version of the plugin from WordPress plugin directory
- Go to Plugins -> Add New in your WordPress admin area
- Click on the ‘Upload Plugin’ button at the top, near ‘Add Plugins’
- Browse and select the zip file you just downloaded, and click ‘Install Now’
quotes-collectiondirectory to the
~/wp-content/plugins/directory of your WordPress installation.
After installation, the plugin can be activated from Plugins -> Installed Plugins in your WordPress admin area. Once activated, the Quotes Collection menu will be visible in your admin menu.
The ‘Quotes Collection’ menu can be located in the WP admin area navigation panel under ‘Posts’, ‘Pages’, ‘Comments’ etc. Under this menu, you can find sub-menu items named All Quotes, Add New, Import, Export and Options.
To add a quote, click on the ‘Add New’ sub-menu. You will be presented with a form to input the quote and its details. The form has five fields
- The quote — the actual quote
- Author — the person who uttered the quote. This field is optional, it can be left blank.
- Source — a book or a website or whatever from which you found the quote. Optional.
- Tags — one or more tags can be input for a quote. Tags can be used to filter the widget or shortcode outputs, and can be used in a variety of ways. This is optional and can be left blank. Two or more tags should be comma separated.
- Public — By default, this is checked. Uncheck this if you want to keep the quote private, ie., a private quote won’t be showed in widget or shortcode outputs.
The quotes thus added will be listed in the ‘All Quotes’ admin page. From this page, operations like editing, deleting, changing the status from ‘Public’ to ‘Private’ and vice versa can be performed.
The collection of quotes can be exported in JSON format from the ‘Export’ page. Similarly there is an ‘Import’ functionality which helps you import a set of quotes stored in a
.json file in JSON format.
Plugin options can be set from the ‘Options’ page.
The ‘Random Quote’ widget
Once the plugin is installed and activated, the ‘Random Quote’ widget can be found in ‘Appearance’ -> ‘Widgets’ menu in the WP admin area. Just drag the widget into a widget area and then choose the widget options.
Following is the list of options in the widget control panel:
- Widget title
- Option to show/hide quote author
- Option to show/hide quote source
- Turn on/off the ajax refresh feature
- Choose random or sequential order for refresh
- Option to refresh the quote automatically
- Show only quotes with certain tags
- Specify a character limit and filter out bigger quotes
The shortcode [quotcoll] can be placed in a WordPress page to display all the quotes in the page.
Different attributes can be specified to customize the quotes to be displayed, number of quotes, the order, paging, etc. Here’s the list of attributes:
Display a particular quote with the specified id. This overrides all other attributes. That is, if id attribute is specified, any other attribute specified is ignored.
[quotcoll id=3] displays a single quote, the id of which is 3. If there is no quote with the id 3, nothing is displayed.
To display all quotes by a specific author.
[quotcoll author="Somebody"] displays all quotes authored by ‘Somebody’.
To display all quotes from a specific source.
[quotcoll source="Something"] displays all quotes from the source ‘Something’.
tags (string, comma separated)
To display only quotes with one or more of the tags specified.
[quotcoll tags="tag1"] displays all quotes tagged ‘tag1′.
[quotcoll tags="tag1, tag2, tag3"] displays quotes tagged ‘tag1′ or ‘tag2′ or ‘tag3′, one or more or all of these.
[quotcoll author="Somebody" tags="tag1"] displays quotes authored by ‘Somebody’ AND tagged ‘tag1′.
When multiple quotes are displayed, the quotes or ordered based on this value. The value can be either of these:
- ‘quote_id’ (default)
Ascending or descending order when multiple quotes are displayed. The value can be either ‘ASC’ (default) or ‘DESC’.
[quotcoll orderby="time_added" order="DESC"] will display all the quotes in the order of date added, latest first and the earliest last.
To introduce paging when a large number of quotes are to be displayed. The values can be either false (default) or true. This can be used in conjunction with ‘limit_per_page’ (see below).
[quotcoll paging=true limit_per_page=30] will introduce paging with maximum of 30 quotes per page.
orderby="random" is used, paging is ignored.
The maximum number of quotes to be displayed in a page when paging is introduced, as described above. The defualt value is 10.
[quotcoll paging=true] will introduce paging with maximum of 10 quotes per page.
The maximum number of quotes to be displayed in a single page ie., when paging is ‘false’.
Example: this can be used to display just a random quote.
[quotcoll orderby="random" limit=1]
quotescollection_quote() template function
The template function
quotescollection_quote() can be placed directly in a template file and a random quote will be displayed in the output in the corresponding location.
<?php quotescollection_quote(); ?>
Below is the full list of parameters (arguments) that can be passed on to this function:
To show/hide the author name
- 1 – shows the author name (default)
- 0 – hides the author name
To show/hide the source field
- 1 – shows the source
- 0 – hides the source (default)
To show/hide the ‘Next quote’ refresh link
- 1 – shows the refresh link (default)
- 0 – hides the hides the refresh link
Refresh the quote in random or sequential order
- 1 – random refresh (default)
- 0 – sequential, with the latest quote first
To refresh the quote automatically. Time interval is the number assigned to this parameter, in seconds. For example,
<?php quotescollection_quote( array( 'auto_refresh' => 5 ) ); ?> will refresh the quote every 5 seconds. Set the value of auto_refresh to 0 to disable this functionality, which is default.
Comma separated list of tags. Only quotes with one or more of these tags will be shown.
Quotes with number of characters more than this value will be filtered out. This is useful if you don’t want to display long quotes using this function. The default value is 500.
Toggles the display of the random quote or return the quote as an HTML text string to be used in PHP. The default value is 1 (display the quote). Valid values:
- 1 (true) – default
- 0 (false)
<?php quotescollection_quote(); ?>
- Uses the default values for the parameters. Shows author, hides source, shows the ‘Next quote’ link, no tags filtering, no character limit, displays the quote.
<?php quotescollection_quote( array( 'show_author' => 0, 'show_source' => 1, 'tags' => 'fun,fav' ) ); ?>
- Hides author, shows source, only quotes tagged with ‘fun’ or ‘fav’ or both are shown. ‘Next quote’ link is shown (default) and no character limit (default).
<?php quotescollection_quote( array( 'ajax_refresh' => 0', 'char_limit' => 300 ) ); ?>
- The ‘Next quote’ link is not shown, quotes with number of characters greater that 300 are left out.
Versions 1.1 and greater support localization. As of the latest version, localization is available in the following languages.
|es_ES||Spanish||Germán L. Martínez (Gershu)|
|fr_FR||French||psykotik, Laurent Naudier (1.4.3)|
|it_IT||Italian||Gianni Diurno (aka gidibao)|
|nb_NO||Norwegian (Bokmål)||Christian K. Nordtømme|
|nl_NL||Dutch||Guido van der Leest, Kristof Vercruyssen|
|pt_BR||Brazilian Portugese||Tzor More|
If you can translate the plugin in your language, please do, and please send me the localized file so that I can add to the next version of the plugin. The localization template file (quotes-collection.pot) can be found in the ‘languages’ folder of the plugin. If you want to translate the plugin in your language, but are not sure how to go about doing it, contact me, I’ll help you out.
Frequently Asked Questions
How to hide the ‘Next quote »’ link?
You can do this by turning off the ‘Ajax Refresh’ feature in widget options.
How to change the link text from ‘Next quote »’ to something else?
This text can be changed from Quotes Collection -> Options in your WordPress admin area.
The ‘Next quote »’ link is not working. Why?
Make sure your theme’s footer.php file has the code
<?php wp_footer(); ?> just before
</body>. If you still experience the problem even after the above conditions are met, contact me.
I have added a number of quotes, but some of the quotes never get displayed in the widget. Why?
If you want all of the quotes to display, make sure all all the quotes fall within the ‘Character limit’. There is an option named ‘Character limit’ for the widget (bottom most, under the ‘advanced options’) with a default value of ‘500’. The value can be changed, or simply removed and the field left blank so that none of the quotes get filtered out based on length.
I have a long list of quotes, and
[quotcoll] puts all of the quotes in a single page. Is there a way to introduce pagination and break the long list of quotes into different pages?
Yes, pagination is supporterd in versions 1.5 and greater.
limit_per_page attributes can be used to achieve this. For example,
[quotcoll paging=true limit_per_page=30] will introduce pagination with a maximum of 30 quotes per page.
Feedback & Support
Bug reports, feature requests, suggestions, appreciation, criticism, all feedback welcome.
You can also rate and review the plugin at WordPress.org.
Make a donation
If you enjoy using the plugin, you can make a donation and support development. Any amount thankfully accepted.