WordPress Theme Options Panel Framework

My Theme Options Panel Framework (TOPF) for WordPress is ready for public consumption and I have released version 1.0. TOPF is a WordPress Options panel appearing in the Appearance section of your WordPress Admin. It is useable within any WordPress Theme.

It was originally work done by Devon Price’s Thematic Option’s Panel and I have reworked it extensively. Devon has also released a non-Thematic specific Plugin for WordPress that others may find quite useful as well.

TOPF is fully WordPress Settings API compliant and integrates a number of useful controls for Theme Developers. Currently available option items are:

//      heading
//      info
//      other
//      background
//      border
//      checkbox
//      color
//      images
//      multicheck
//      radio
//      range
//      select
//      select2
//      textarea
//      text
//      typography
//      upload

The Theme Options Panel Framework makes it easy to include an options panel in any WordPress theme. TOPF has been built so that theme developers can concentrate on making the real theme and not spending a ton of time on creating an options panel from scratch. It’s free to use in both commercial and personal projects.

I have made extensive use of TOPF in my Divergence Theme for Thematic and WordPress.

Here is a look at what the Typography Option Item looks like in an Options Panel:

Installation

Place the options folder in your theme or child theme folder.
Define TOPF_OPTIONS with the name of your options table entry for WordPress. All options are bound into an array and filed into the TOPF_OPTIONS entry.
Include the main options.php file into your theme:

define( 'TOPF_OPTIONS', 'theme_divergence_options' );
require_once( get_stylesheet_directory() . '/options/options.php' );

Setup the options you wish to use in The Array ($topf_theme_options) found in ./options/theme_default_options.php
Alter the validation for each option in ./options/option-register.php
Include the implementation file (change and add your own implementations here)

require_once( get_stylesheet_directory() . '/options/options-implement.php' );

You can download or view the source code from my GitHub repository. (the Download button is near the top right)

Enjoy!

 
 

3 Responses to WordPress Theme Options Panel Framework

  1. Nim says:

    Hi,

    I’m trying to install your option framework in my non-thematic WP theme.
    i’m wondering how do I display values in the website?
    ‘get_option’ doesn’t seems to be working

    thanks

  2. Jeff Parsons says:

    Hi Nim,

    At the top of your functions.php file one of the first things you should have is:

    define( 'TOPF_OPTIONS', 'my_wordpress_options_array_entry' );
    require_once( get_stylesheet_directory() . '/options/options.php' );

    $my_options = get_option( TOPF_OPTIONS );
    if ( $my_options['my_option_name'] ) {
        // do something
    }

    Everytime your theme runs, the Options Panel creates a global variable which you could access in your theme instead. $topf_options

    So, you could call get_option() as above, or:

    global $topf_options;

    if ( $topf_options['my_option_name'] ) {
        // do something
    }

    Hopefully, you have modified theme-default-options.php with all your options, also modified options-register.php with the validation for those options you have defined.

  3. Johnette says:

    Heck yeah this is exactly what I need.