I recently found out about Ozh’s Theme Toolkit, so thought I would give it a go with a theme I am messing with. Essentially it allows you to add features that are them administered through a page within the WordPress back-end.
It only took about 3 hours to get it working, but I finally achieved my goal1:
function theme_titleswitch() {
global $mytheme;
if ($mytheme->option['title'] == 'Option1') {
echo '<div id="title">
<a href="' . get_settings('siteurl') . '">' . get_settings('blogname') . '</a>
</div>';
}
}
As for what it does, it allows a WP administrator to turn the title on and off via a radio button. Not exactly earth-shattering technology but it allows presentation to be altered without hacking, and I wrote it.
I would like to see a repository somewhere for these user-created functions, which would avoid the need to roll-your-own every time.








Doing such a repository was an idea I had first, but then I realized it would be not so useful : every function created is mostly intricated with the theme it’s been written for, thus not very useful for others.
Good point, though I was thinking more of a collection of examples.
Admittedly, the functions for the Theme Toolkit are the same as for WP in general, it is just that I have little exposure to such code (and i eventually solved my bugs by trolling for examples in
template-functions-author.php).I thought this toolkit was something used to modify the theme to suit their needs. I’ve been testing around with my AlternateO theme these days, and discovered that this Toolkit thing can’t work!
St. Chatterbox, it depends what you want to do. Certainly it is aimed at the ‘non-casual’ user, but I think it will be a useful when themes are packaged with it. E.g. with my Stanch theme, the readme file lists 2 or 3 places where you have to edit files to allow asides to work, with the toolkit it would be a simple case of the user entering the appropriate number in a box in their admin panel.
So far, for the theme I am working on I can:
Turn the title on and off
Assign paths to the archive and about pagesI am not sure what else I need yet, but the key though you can enable things to be done without template hacking.