Viewing 3 replies - 1 through 3 (of 3 total)
  • You can use the following code:

    function cm_to_wp(){
    	if(ot_get_option('cm_title'))update_option('blogname', ot_get_option('cm_title'));
    	update_option('blogdescription', ot_get_option('cm_description'));
            // code ....
    }
    add_action('after_setup_theme', 'cm_to_wp', 2);

    Plugin Author Derek Herman

    (@valendesigns)

    The ot_get_option() function is loaded during a hook and is not directly accessible from the functions.php file. Like Vincent demonstrated, you need to wrap your code in a function that is called from an action hook to avoid the error message.

    Cheers,
    Derek

    Thread Starter meanmaru

    (@meanmaru)

    Thanks Vincent and Derek.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to use "ot_get_option" in function.php ?’ is closed to new replies.