0

I successfully created my theme options page using this framework:

https://github.com/devinsays/options-framework-theme

The problems Is that when, for example, I try to load the Option: 'logo_image'

global $options; var_dump($options); /* dumps NULL */

and

foreach ($options as $value) { 
    if (get_settings( $value['id'] ) === FALSE) {
        $$value['id'] = $value['std'];
    } else {
        $$value['id'] = get_settings( $value['id'] );
    } 
    echo $$value['id']; /*prints nothing*/
}

And

echo get_option(‘logo_image’);   /* also prints nothing */

This is how I am calling the framework in my functions.php

if ( !function_exists( 'optionsframework_init' ) ) {
    define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/inc/' );
    require_once dirname( __FILE__ ) . '/inc/options-framework.php';
}

What am I missing?

2

If you've done everything correctly during the setup, then you should be able to load the logo_image option like this:

$my_theme_prefix_option = of_get_option('logo_image');
  • aaaaaaaah!!!! of_ (options framework, right?) – Toni Michel Caubet Apr 26 '13 at 10:20
  • Exactly. :) Are you able to retrieve the option now? – Fränk Apr 26 '13 at 10:22
  • Yes! Thanks a lot! I wish I posted this sooner... :) – Toni Michel Caubet Apr 26 '13 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.