Widgetification!

A few years back, the WordPress developers introduced a little feature called widgets. The idea is to make it easier to have various stuff[1] in your sidebar. Without widgets, instead of editing sidebar.php in your theme folder, and typing in loads of code, being careful to use calls like this:

<?php if (function_exists('some_function'))  some_function(); ?>

if you want to use a plugin function[2], and otherwise typing in lots of HTML, PHP, and possibly JS and QZ[3].

Widgets save you doing all of that. WordPress comes with built in ones, themes can include their own (in the functions.php) file, and plugins can add plenty more. There’s an almost easy to use interface to add and configure them[4], and you can rearrange your widgets to be higher or lower on your sidebar (or sidebars if you have two).

But being the kind of geek I am, with my own ingrained habits, I’d never got round to moving Losing it[1] to use widgets. Until today, that is. The sidebar is now all done with widgets. Some bits were done with plugins I was already using (the random pictures and the LastFM music thingies), others are just text widgets (you can have a widget containing any text and HTML you like, more or less), one involved making a change to the theme’s functions.php file (I wanted the little icons for the RSS Feeds bit), and one was a major effort, but I’ll talk about that in a separate post.

Anyway, it all appears to work, and it’ll be easier to rearrange the sidebar or to add or remove bits in future. Cool. I really should get round to these things a bit quicker, but I never seem to find the tuits…

[1] Technical expression :cheesy:
[2] Failure to do so can result in lots of mess if you deactivate a plugin…
[3] I may have invented one of those
[4] Its implementation in WordPress 2.5 is a little more awkward than it might be, but it is usable