Quote of the day plugin
The Quote Of The Day plug-in manages quotes displayed on your WordPress or WordPressµ blog. Unlike other QOTD plug-ins that link to external web sites, the Quote Of The Day plug-in stores quotes, and related references, in your WordPress database. In addition, this plug-in conforms with the HTML 4.01 specification regarding <blockquote> and <q> tags.
Overview
There are three elements of a quote, the author, the citation, and the quotation itself. The cd-qotd plug-in administrative page allows you to manage these three elements. You may also select whether a quote is displayed using the <blockquote> or <q> (inline quote) tags, as well as, the frequency at which different quotes are displayed. Specifically, you can select to have a random quote displayed with each new page (page refresh), each hour, or each day.
Note: You can see the cd-qotd in use on this site at the bottom of the right-hand sidebar.
There are a couple of topics I want to address here. One is the proper use of the CITE attribute. The other is selecting a BLOCKQUOTE or Q (inline) quotation type. The cd-qotd plug-in allows you select either of these tags for use within your site. Your use of these elements should conform to your style guide.
The CITE attribute was designed to provide a reference to the source of the quotation. Here is the definition taken from the w3c specification.
The value of this attribute is a URI that designates a source document or message. This attribute is intended to give information about the source from which the quotation was borrowed.
Take a look at the source of this page to view the CITE attribute. As an example referencing this web site, you may elect to use a generic style, such as:
cite="Coyotes Designs. Available at: http://coyotesdesigns.com/quote-of-the-day-plugin/. 03 March 2010".
Whether you select to use either the BLOCKQUOTE or Q tag depends on the type of quotation you want to display. The intent of these tags is to cover a block-level quotation or an inline quotation, respectively. I did not code any restrictions into the cd-qotd plug-in on which tag you select. That means you can use the inline quote tag for block-level quotations.
One very important piece of information regarding the use of the inline Q tag, is whether to use quotation marks to enclose your quotation. According to the specification, quotation marks are automatically inserted by the user agent.
Visual user agents must ensure that the content of the Q element is rendered with delimiting quotation marks. Authors should not put quotation marks at the beginning and end of the content of a Q element.
Installation
The cd-qotd plug-in is installed as any other plug-in.
- Download the cd-qotd plug-in to your local machine.
- Extract the files retaining the folder structure.
- FTP the cd-ad-sponsor files to your WP Plugins directory. (Single and MU versions)
- Activate the plug-in through the 'Plugins' menu in WordPress.
You may also use the upload feature in your WordPress Plugin management page to upload the zip file and install the plug-in.
Management Page
When you activate the cd-qotd plug-in, you will see the CD QOTD menu option in your Settings menu. Activation also creates the cd_qotd database table in your WordPress database, and inserts a single default quotation. This table contains all data associated with the quotations you want displayed on your site. Additional information, such as the frequency that quotes are displayed, is inserted into the options table.
Selecting the CD QOTD menu option displays the cd-qotd Management page. This page lists all currently defined quotes within the database, sorted alphabetically by author name.
There are also two options available, an option to add a new quotation, and the option to define the settings. I will discuss each of these options in the following sections.
Add Quote Page
The Add Quote page displays the data fields necessary to define a quotation. These data fields are defined as follows.
- Author Name
- This field is where you enter the name of the author of this quotation. This field is required.
- Citation
- This field is where you enter the printed or URI reference for this quotation. Print references may include ISBN nomenclature, publication titles, etc. This field is optional, although highly recommended.
- Quote
- This field is where you enter the actual quotation that you want to present. When entering quotations, do not include quotation marks. This field is required.
TIP: I have received emails asking about embedding links within a quotation, and also about wrapping the author name within a link. The answer is, Yes. You can add normal anchor tags to both the author name and quotation fields. These links will be displayed in the quote of the day.
Settings Page
The Settings page displays the options to define the presentation of a quotation. These data fields are defined as follows.
- Display Type
- This data field allows you to select either the
BLOCKQUOTEorQtag in which to display the quotations. - Display Frequency
- This data field allows you to select the frequency in which to rotate through the defined quotations. You may select to have a new quotation displayed with each new page, at the top of the hour, or for each new day.
Modifying Your Theme
You may be wondering why this plug-in wasn't designed as a widget. Well, two reasons. First, I didn't want to relegate the cd-qotd plug-in to only the sidebar, and two, well, see the first reason. :)
[edit]The QOTD plug-in was upgraded to function as a widget in release 1.1.0.[/edit]
In order to display your quotations you need to add the cd_qotd_quote() function within your desired theme file. For example, you can include the function call within your sidebar.php file as demonstrated on my site. (See the sidebar for an example.)
Note: The cd-qotd plug-in displays your quotations in your blog theme as styled by your definitions in the /css/cd-qotd.css file. I recommend that you at least re-define the BLOCKQUOTE element definition so that the quotation is displayed differently than other block quotes on your web site. You may elect to display your quotation across the top portion of your blog page, in which case, you would add the cd_qotd_quote() function to your header.php file. This, of course, depends on the structure of your theme files.
The syntax is:
No arguments are passed. This is simply a function call that outputs a random quotation in the style you define.
If you intend to display the QOTD in the sidebar or main body of a page, you will need to copy the existing block segment HTML tags that your theme uses to display the desired format, and insert them where you want the QOTD to appear. You then insert the cd_qotd_quote function inside the content area of that block. You can see an example of the block of HTML tags used by this theme by viewing the page source. Your theme will be different, so I cannot offer a tailored example. I will, however, be more than happy to assist you if you so desire. Feel free to contact me on Skype.
Conclusion
I hope that you find this plug-in beneficial to you as it has been for me. Please feel free to comment or make suggestions for future enhancements.








Is there a way, or will there be a way in the future, to display an archive?
For example, I want to put up a new quote daily, but I don't want to have to return everyday to put it up, so I add it to the list and tell the quote to go up daily, as this is set up to do. However, I would like the quote to be marked as displayed and then show up on a page indicating that the quote was displayed in the past. With options available to show the day and month each quote was displayed and also to be able to sort by month and year if I choose.
Is this possible? Thank you for your time!
Hi niaskywalk,
That is an impressive list of features. :)
I think what you are looking for is more of a news, or announcement, type plug-in. I think they would offer an archival feature to the news items that are displayed, but i am not sure.
I definitely can see the usefulness in such a plug-in, though, and it is definitely possible. Maybe I could combine that functionality with this plug-in for a future release. Thank you for your thoughts.
Coyote
Running Version 2.9.2 and the 24 hours option is not working just stays on the same quote the for days. Whne you get a moment could you look into the please.
Also how hard would it be to take the same concept of this and make it so I could add it to the sidebar or widget and have a word of the day script also?
Hi Bill,
I certainly will take a look. I will let you know of any changes.
A word of the day plug-in would be simple. As soon as I complete a couple of projects, I'll spend some time on it as well.
~Coyote
Hello Coyote,
This is a very promising plugin.
However I am experiencing the same issue as Bill above.
The quote hasn't changed in the last 24 hours, there are currently 5 quotes in the database.
If it helps, I am using it on WordPress MU 2.9.2 inside BuddyPress 1.2.3.
Keep up the good work! ;)
Hi, and thanks.
I'll take a look at this and get back to you later today or in the morning.
Thanks for your input!
Coyote
[update: 05-26-2010 05:30]
I am currently reviewing this issue and will get back to you.
Is there a way to assign access to this plugin to users other than Admin? I have folks in the Editor role and I'd like them to be able to add quote material.
If that's not currently possible, could be a future feature? :)
Thanks!
Hi Oddball,
Reminds me of Donald Sutherland in the movie Kelly's Heroes. :-]
I can certainly look in to adding a configuration option whereby the administrator may select from the available roles/capabilities to allow access. That work for you?
Thanks for your interest!
~Coyote
I can't find a way to remove quotes? Especially the default Mark Twain one that came with the plugin upgrade.
Hi,
I am adding a delete feature for the next release. Until then, you can simply edit the existing quote overwriting it with the quote you want to use.
~Coyote