There are many posts on the interwebs about how to use the WordPress Settings API to create theme options for your WP project. If you find these all too intimidating and time-consuming, there are a number of plugins and scripts to make the task easier:
WordPress AdminPage Class
I have used Markus Thömmes’ WordPress AdminPage Class for a few projects. Back when I needed it, it was the most attractive alternative I could find to building my own page from scratch.
The AdminPage Class was easy to implement. Following the documentation, you simply include the script in your
functions.php file and then pass arguments for a variety of objects. You can see an example in my Design Presenter theme functions file.
The script supports the following headings and fields with styles true to the WordPress admin:
There are a few caveats though: The class has not been updated since 2010 (but it is still functional with WP 3.3.1), it doesn’t pass the Theme-Check plugin so a theme using it will probably not pass theme review to appear in the official Theme Directory, and it’s $8 or $40 depending on the license you purchase.
Options Framework Plugin
If spending money is not an option or you need more complex setting types (like image radio buttons or a color picker), then the Options Framework Plugin might do the trick. This popular plugin is available for download from the official Plugin Directory and a theme containing examples of using each option type is available from the plugin author, Devin Price.
Though I’ve yet to use the Options Framework Plugin on a production project, based on recent tinkering it provides a solid foundation for creating functional and attractive theme options pages. It’s also been forked into Jeff Parsons’ Theme Options Panel Framework, which was last updated 11 months ago so I would stick with the more frequently updated Options Framework Plugin.
NHP Theme Options Framework
NHP Theme Options Framework by Lee Mason includes built-in validation, custom error and warning handling, and tons of field types. It’s well documented and each function and action may be hooked and customized. The framework’s default styles and tabbed interface look great.
I have not yet used NHP Theme Options Framework, but it’s at the top of my list to use for my next project that will require a nice theme options page.
ProPanel WordPress Theme Options Panel
But if support and easy implementation are important to you, then ProPanel might be worth the $15 regular license or $75 extended license because the framework is backed by TrueThemes support, which includes video instructions on initial setup. TrueThemes’ responses in the CodeCanyon comments are noticeably fast.
ProPanel includes image radio buttons and a color picker that its competition on CodeCanyon, AdminPage Class, doesn’t offer but lacks the sliders (nice for letting users choose from a range of values), datepickers and visual editor textareas that AdminPage Class supports.
CheezCap – Cheezburger Custom Administration Panel
I almost didn’t include the Cheezburger Network’s CheezCap framework because it’s very basic and a bit dated (last updated April 2011). However, I think it’s worth a mention because the creators of Lolcats were generous enough to release their options framework under the GNU GPL v2, and it was one of the first theme options frameworks I can remember being released. Like many of the frameworks, you simply require the framework file in your
functions.php, and then build options. Compared to the rest of the frameworks in this post, the types of fields offered by CheezCap are very limited:
- Boolean Option (true/false dropdown)
- Text field
While simple, CheezCap obviously gets the job done on a network of high traffic sites!
The UpThemes Framework
Last but not least is the popular UpThemes Framework, which UpThemes uses on its own beautiful themes. This framework includes prebuilt managers for executing options developers frequently include in their themes anyway:
- An image manager for uploading and resizing logos and background images
- A typography manager for using Google Web Fonts (I’m a big fan of that on this very blog—its type is entirely set by Google.)
- A layout manager for making page templating more accessible to end users
- An SEO manager for title tags and keywords (Use WordPress SEO by Yoast instead.)
- A color manager for adjusting color schemes.
The framework also has the nifty ability to export/import options so users can easily transfer or back up their settings.
Not only is the UpThemes Framework free and easy to implement in your theme, it’s licensed with the GNU GPL v2 and working examples are bountiful.
I’ve done my best to find viable WordPress theme options plugins and frameworks on Google and in my gargantuan WordPress development bookmarks folder, but if I missed your favorite, please let me know in the comments so I can take a look and add it!
A few days after I published this, Otto on WordPress published a tutorial on using the Theme Customizer, which will be released with WordPress 3.4 before the end of the year. It’s great to see the Settings API expanded upon with a slick options interface. Check out this video for a sneak peek:
Coming soon: A post on advanced custom fields plugins and frameworks for WordPress.