Easily Create Theme Options for WordPress Theme: Part 1

In high quality and premium WordPress theme you might see theme options feature from admin panel. Through theme option you can change many settings of that theme very easily. Wonder how they have created this theme options? You can do it manually without using any plugin if you have excellent knowledge in programming. But if you are not a programmer then how would you do it? You came to right place for the solution. We will add theme options by using one excellent plugin Options Framework. By using this plugin you can easily create theme options for WordPress theme.

Easily Create Theme Options for WordPress Theme:

In this part we will learn the step to follow for setup the plugin properly. First of all download the plugin and uploade it to your WordPress blog or site.  Before activating the plugin add the following function to your theme’s functions.php file:

[html]

if ( !function_exists( ‘of_get_option’ ) ) {
function of_get_option($name, $default = false) {
$optionsframework_settings = get_option(‘optionsframework’);
// Gets the unique option id
$option_name = $optionsframework_settings[‘id’];
if ( get_option($option_name) ) {
$options = get_option($option_name);
}

if ( isset($options[$name]) ) {
return $options[$name];
} else {
return $default;
}
}
}

[/html]

Then get the file options.php from here and place it to your current theme’s folder. This is the option page you will see from admin panel.Then activate the plugin and  you will see The “Theme Options” menu appeared in Appearance menu:

add-theme-option-wordpress-2

Here is the default options you will see:

add-theme-option-wordpress-1

If you understand so far then please check the 2nd part to Create Theme Options.

Author: mytutorialguru

Share This Post On

Submit a Comment

Your email address will not be published. Required fields are marked *