devinsays/options-framework-theme

Sane Defaults problem. How to use with plugin already with TGM installed?

Closed this issue · 2 comments

Hello Devin,
Thanks a lot for this great plugin. However with the last changes in WordPress.org Theme Requirements, I cannot get this plugin work with sane defaults.

I am following the article: http://wptheming.com/2014/11/options-framework-theme-v1-9-0/ but it does not work to me.

I use TGM to "recommend" the plugin to be installed. In my theme folder I also include "options.php" .

function optionsframework_option_name() {
       $themename = get_option( 'stylesheet' );
       $themename = preg_replace( "/\W/", "_", strtolower( $themename ) );
       return $themename;
}      
function optionsframework_options() {

    $options = array();

    $options[] = array(
        'name' => __('Basic Options', 'coupon'),
        'type' => 'heading');

    /*$options[] = array(
        'name' => __('Favicon Upload', 'coupon'),
        'desc' => __('Upload Your Favicon icon here. Please upload a 16x16 icon.', 'coupon'),
        'id' => 'favicon_upload',
        'std'=>'',
        'type' => 'upload');
    */    
    $options[] = array(
        'name' => __('Footer Sidebars', 'coupon'),
        'desc' => __('Select Footer Sidebars Number.', 'coupon'),
        'id' => 'footer_sidebars_number',
        'std' => '1',
        'type' => 'radio',
        'options' => array('1'=>__('1','coupon'),
                           '2'=>__('2','coupon')
                           )); 
    return $options;
}

Now I cannot understand what to write in functions.php in order to use my options.php with the plugin and respect also the "sane defaults" for the WordPress Theme Repo. I am writing the "of_get_option" function which is mentioned in the article above but it does not work.

Sorry for my english.

If you're using the plugin version, it does not apply. The updates are only for people that bundle the theme version.

Haven't decided what to do with the plugin version since it would break a lot of sites if I suddenly switched it.

Ok thanks a lot for your quick reply!