Getting option value not work in titan-framework for wordpress

Is here anyone use titan framework? I have got a problem for getting option value and save option.
I am trying to create a logo image uploader option but can not get the value as well as not save the valu.

here is my code:

Read More
add_action( 'after_setup_theme', 'logo_func' );
function logo_func() {
    $titan = TitanFramework::getInstance( 'prospectwizard' );
    $logoValue = $titan->getOption( 'theme_logo' );
}

how i call the for getting option value

add_action( 'after_setup_theme', 'logo_func' );
function logo_func() {
    $titan = TitanFramework::getInstance( 'prospectwizard' );
    $logoValue = $titan->getOption( 'theme_logo' );
}

Related posts

Leave a Reply

1 comment

  1. You are not returning anything in your function, understandable as the tutorials on the Titan site are far too basic.

    You should be getting the options value like this (from the code you posted):

    add_action( 'after_setup_theme', 'logo_func' );
    function logo_func() {
        $titan = TitanFramework::getInstance( 'prospectwizard' );
        return $titan->getOption( 'theme_logo' );
    }
    

    And really it should be like this to be more universal:

    function read_option($id){
     $titan = TitanFramework::getInstance( 'prospectwizard' );
     return $titan->getOption($id);
    }
    

    Then you can use read_option('logo_func') or read_option('NAME_OF_OPTION') anywhere in your theme 🙂

    Try the tutorials here instead, should answer all your questions:
    [http://freshwebdev.com/save-read-option-wordpress-titan-framework.html%5D%5B1%5D

    [1]: http://freshwebdev.com/save-read-option-wordpress-titan-framework.html including saving options correctly