Quote This started a small bit of code I started using on my personal blog around 2006. It was just a simple PHP function for displaying a random quote from whatever category I wanted. It has always been one of my favorite scripts, so I figured I'd beef up the functionality a bit and release it as a plugin.
The plugin's basic functionality — displaying a random quote — is essentially the same, but I've made it easier to use by including a shortcode and widget version of it.
I realize there are tons of quote plugins out there, but I'm glad you're taking some time to try this one out. You are welcome to offer suggestions on how to make it better.
quote-this.zip
folder.quote-this
folder to your /wp-content/plugins
directory.Once you've activated the plugin, you'll have three choices on how to use the plugin:
This method of calling the plugin is ideal for your template files (i.e., single.php
, index.php
, sidebar.php
). What we'll be doing is using a PHP function.
A basic example:
<?php if ( function_exists( 'quote_this' ) ) quote_this(); ?>
To input parameters, you may either use function-style parameters (preferred) or query-string-style parameters.
Example with function-style parameters:
<?php if ( function_exists( 'quote_this' ) ) quote_this( array( 'format' => 'p', 'type' => 'film' ) ); ?>
Example with query-string-style parameters:
<?php if ( function_exists( 'quote_this' ) ) quote_this('format=p&type=film'); ?>
The [quote-this]
shortcode is ideal for adding quotes to your posts and pages from the Write Post/Page screen. It's simple and requires no PHP knowledge.
A basic example
[quote-this]
You may also choose to input some parameters to customize the output.
Example of the shortcode with parameters:
[quote-this type="life" format="blockquote"]
The Quote This widget is pretty straightforward. Just head over to the Widgets screen while in your WordPress admin and find the widget labeled Quote This.
You'll see several options to customize the output of your widget. These are the plugin parameters, which are explained below. You may also use this widget any number of times.
Quote This has a few parameters, which can be accessed through the function call, shortcode, and widget. Here are the defaults:
$defaults = array(
'type' => 'all',
'orderby' => 'rand',
'format' => 'blockquote',
'separator' => '-',
'echo' => true,
);
all
(default), art
, film
, friendship
, individual
, life
, literature
rand
(more options will be added in the future)blockquote
(default), p
-
)[quote-this]
shortcode.)true
(default), false
Quote This will give you three CSS classes to work with:
quote-this
: Class of the element that wraps the quote and quote author.quote
: Class of the element that wraps the actual quote.quote-author
: Class of the element that wraps the quote author.I have several plans for this plugin in the future. I'd love to add other options, such as the ability to list more than one quote or order the quote(s) however we please. Maybe even the ability to show quotes from a specific author.
The main goal is to add more quotes to the collection. If you have a collection of quotes sitting around, feel free to send me an email with quotes you'd like to see added. We can even add new categories of quotes. Just put any quotes you'd like in a text file and send them to me (include the quote authors, please).
I run a WordPress community called Theme Hybrid, which is where I fully support all of my WordPress projects, including plugins. You can sign up for an account to get plugin support for a small yearly fee ($25 USD at the time of writing).
I know. I know. You might not want to pay for support, but just consider it a donation to the project. To continue making cool, GPL-licensed plugins and having the time to support them, I must pay the bills.
Cleaner Gallery is licensed under the GNU General Public License, version 2 (GPL).
This plugin is copyrighted to Justin Tadlock.
2006 – 2009 © Justin Tadlock. All rights reserved.