NOTE: This tutorial is old and out of date and predates much of what is now state-of-the-art in the WordPress world. Instead of pursuing this method, check out One Design’s
How to Create a WordPress Theme Options Page for an up-to-date take on creating theme options pages. I’ve removed the downloadable .zip file containing my old functions.php in order to remove confusion.
NOTE: The contents of this post may shift about a bit as time goes on. For some reason, the code-highlighting plugin I’m attempting to use isn’t working correctly. There may end up being some more code snippets that find their way into this post if I figure out what’s going wrong. Fixed it by moving to a different code-highlighting plugin. Dunno what the issue was, but it’s gone now.
For theme authors looking to customize their theme offerings with a fancy options/administration screen, functions.php
is the place to start. By default, WordPress loads it whenever your theme is active — on the front page or on the back end. A brief discussion on the wp-hackers mailing list today prodded me to post the following code from the functions.php
I’m including in Elbee Elgee (whenever I get around to releasing it, that is…). I took the guide offered by The Undersigned as a jumping-off point and added some nice tweaks. In particular, The Undersigned’s version only allowed for text and select form inputs — I wanted/needed more flexibility.
The file itself is fairly simple and almost self-documenting, but in the interests of full disclosure, I’ll comment upon it here:
1. I set the descriptive and short names of my theme at the head of the file.
$themename = "Elbee Elgee";
$shortname = "lblg";
Continue reading “A Theme Tip For WordPress Theme Authors”