Quartz WordPress PluginBy Binny V A • Nov 21st, 2008 • Category: Blogging, Scripts, WordPress
Quartz Plugin lets you show random quotes/tips/links/pictures/something else to visitors. These quotes can be added from the admin side. You can add these one by one – or you can bulk import the stuff from a text file.
For those of you who are not in the know, this is the Plugin Week. Actually, this is the final day of the plugin week. In Plugin week, I release a new WordPress Plugin each day, every day for one week. This is the fifth plugin in that series. The plugins released so far are…
- Eventr WordPress Plugin
- Autofields WordPress Plugin
- Pollin WordPress Plugin
- Surveys WordPress Plugin
Note 1: Quartz is a beta plugin(as are most of the plugins released in the Plugin Week) – so watch out for bugs. And trust me, there will be a lot of them.
Note 2: I would recommend that you don’t install Quartz right now. It has not yet been accepted into the WordPress Plugin Repository. You can install it using the zip file I provide below – but then there will be some problems with auto updating of the plugin. Its better to wait until WordPress accepts the plugin before installing it. I’ll update this section when that happens. UPDATE: WordPress have accepted Quartz – feel free to install it now.
- Download the zipped file.
- Extract and upload the contents of the folder to /wp-contents/plugins/ folder
- Go to the Plugin management page of WordPress admin section and enable the Quartz plugin
- Go to the Quotes Management page(Tools > Manage Quote) to create or edit Quotes
- You can add the Quartz widget by going to the widget area and drag-dropping it into your sidebar. Add the code <?php if(function_exists(‘quartz_show’)) quartz_show() ?> in your template – this will display the quote at that location.
The most apparent use of the plugin is to show random quotes to your visitors. Something like the famous Hello Dolly plugin – but for the client side. It also useful for showing small tips – say you are running a linux blog. You can insert useful linux commands with a small description into the quotes database – and the visitors will see random linux commands when they visit a new page. You can even upload image and add that to the database – users will see the a random image on each visit.
After installing the plugin, go to the Quartz Management page(Manage > Manage Quote). Now you can create new quotes.
A better and easier way to do this is to use the bulk import method. You can use that to import a text file full of quotes into the database. Each line in the text file must have a quote in it. An example is the Celebrity Quotes File. You can import that file by entering the value ‘http://binnyva.com/pro/dos/boot_booster/quotes/celebrity.txt’ in the ‘Remote Text File’ field.
After the quotes are ready, you have to modify the template code a bit. Go to the location in the template where you want to show the quote and add the code…
<?php quartz_show() ?>
This function can take two arguments…
- The first argument decides how many quotes must be shown. It is an optional argument and it defaults to 1.
- If you are showing more than 1 quote, use this string to join the quotes. The value defaults to ‘<br />’.
<?php quartz_show(3, '<br />') ?>
If you are trying to insert the quotes into the sidebar, this might be the way(might be different depending on your themes code)…
<li><h2>Random Quip</h2> <ul> <li><?php if(function_exists('quartz_show')) quartz_show(2, '</li><li>') ?></li> </ul> </li>
See it in Action
You will see it running in my WordPress Demo Blog – look at the sidebar under the heading ‘Random Quips’. It don’t look all that refined – but that’s the themes fault. And I was too lazy to fix the theme
If you have any suggestions or notice any problems with the plugin, post it in the Quartz forum.
This should be the last plugin of my Plugin Week – but since you have been such a wonderful audience, I’ll throw in one more – as a bonus. It will be released tomorrow. Until then!