Adding Quotes As Customizable Content
Hello there! This is _steve, and Geof has added me as an author here for my incessant tinkering in the World of Wordpress. Today I’m going to teach you how to add quotes to your blog using a very simple plugin.
What you need:
1) An FTP program and FTP access to your blog. FTP programs like CuteFTP and SmartFTP are available for free; and if your FTP access hasn’t been configured yet, Geof can help you with that.
2) This plugin. It’s in .zip format; right-click the link and download it to your computer. Personally, I like to download things to my desktop, so I know I won’t lose them in the maze of directories and subdirectories that makes up a computer.
After you’ve extracted the files from the .zip file, you’ll need to do a very simple bit of uploading via FTP. I’ll show you how to do it, don’t worry; just do what I tell you and you won’t break anything.
1) Upload edit-quotes.php to public_html/wp-admin.
2) Upload wp-quotes.php to public_html/wp-content/plugins.
Now go to your Wordpress dashboard (that’s the admin screen where you write posts and do all those other cool things), click on Plugins at the top, and look for “Random Quotes.” Activate this plugin.
Now click on Manage at the top. You’ll see that “Quotes” now appears as an option under Manage. Click on Quotes and add/remove/edit whatever quotes you want. Providing an author for the quote is optional.
The only thing you might be concerned about is the length of your quote, depending on how you want to use the plugin. There are two principal things you can do with this plugin:
1) Create a page of quotations. This is incredibly easy. All you have to do is create a page and insert <!–wp_quotes_page–> into the text of the page. If you only want a page with the quotes, then just create a blank page and only put this in the text of the page.
2) Insert a quote into your theme. There are any number of ways you can do this, limited only by the design of your theme and your imagination. Below, I’ll show you two common applications - creating a randomizing subtitle that changes with each page reload, and inserting a random quote into your sidebar.
Creating a randomizing subtitle
Whew…that sounds tough! But I promise you that it’s very, very easy. Once again, you’ll need FTP access to your blog. And you’ll also need a theme that already has a subtitle encoded into it.
Geek Note: It’s actually possible to create your own class in style.css and, by playing around with the pixel-notated margins, to insert a randomizing subtitle into a theme that otherwise has no subtitle. I’m not going to expound any further on that, though, because if you understood what I just said, you’re smart enough to figure out how to do it on your own. I only mention it here because this was how I first created a randomizing subtitle in WP 1.2.
Now, using your Wordpress Dashboard, click on Presentation -> Theme Editor, and scroll down to the bottom of the file called Header. You’ll see a bit of code somewhere near the bottom, probably surrounded by other code you may or may not understand, that reads like this:
<?php bloginfo(’description’); ?>
All you have to do is delete exactly and ONLY that bit of code (and none of the other bits of code surrounding it), and replace it with this:
<?php wp_quotes_random(); ?>
Now save the file…and that’s it! Now you have a randomizing subtitle on your blog. If you find that you can’t edit the file, contact Geof and he can fix the problem for you.
Inserting a random quote into your sidebar
This is only a tiny bit more difficult. In the Theme Editor, click on Sidebar. You’re going to be inserting the same bit of code as above - <?php wp_quotes_random(); ?>
Now here comes the only tricky part: figuring out where to put the quote. You definitely do NOT want to put it above the code that reads <div id=”menu”>…but where you do put it is up to you. If you don’t really know what you’re looking at, try experimenting with different places. Just remember to ONLY insert the code above, and don’t delete anything unless you know what you’re doing. If you put it in a place that messes something up, or if it just doesn’t look good there, don’t worry; just go back to your Theme Editor, erase the code you added, and try putting it somewhere else.
Once you’ve found that place…that’s it! You’ve successfully added a randomizing quote to your sidebar. Congratulations!
Geek Note: the website and various instructions/recommendations for the plugin is here. The quotes are stored in a specially-created table in the database, so if you ABSOLUTELY MUST delete the quote data you’ll need to use your cPanel install to delete the table called “wp-quotes” in phpMyAdmin. Warning: if you don’t understand any of this, just ignore it. Even if you deactivate and uninstall the plugin from Wordpress, you’re not hurting anything by leaving the quotes table in the database. In fact, if you don’t know what you’re doing, it’s better to just leave the database alone.
April 3rd, 2006 at 4:14 am
[...] The new quotes plugin I wrote about for the About blog came with one tiny little problem - no more Valid XHTML 1.0, which is irksome to a weirdo geek like me. (Especially since I’ve been so proud of this theme’s valid XHTML and CSS!) So a bit of mucking around in wp-quotes.php, and a bit of reading on the validator page, revealed a simple solution, which I give to you now. [...]