Plugin Directory

Quotes Collection

The quotescollection_quote() template function

The quotescollection_quote() template function can be used to display a random quote in places other than sidebar.

Usage: <?php quotescollection_quote('arguments'); ?>

The list of parameters (arguments) that can be passed on to this function:

  • show_author (boolean)

    • To show/hide the author name
      • 1 - shows the author name (default)
      • 0 - hides the author name
  • show_source (boolean)

    • To show/hide the source field
      • 1 - shows the source
      • 0 - hides the source (default)
  • ajax_refresh (boolean)

    • To show/hide the 'Next quote' refresh link
      • 1 - shows the refresh link (default)
      • 0 - hides the hides the refresh link
  • tags (string)

    • Comma separated list of tags. Only quotes with one or more of these tags will be shown.
  • char_limit (integer)

    • 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.
  • echo (boolean)

    • 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)

Example usage:

  • <?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('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('ajax_refresh=0&char_limit=300'); ?>

    • The 'Next quote' link is not shown, quotes with number of characters greater that 300 are left out.

Download

FYI

Compatibility beta

Your Setup

Log in to vote.

The Consensus (1 reporting)

100%
100,1,1

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(31 ratings)