Generally, you cannot access local variables in a function from outside the function, so this…
function func() {
$var = 2;
}
$var = 1;
func();
echo $var;
would result in “1”.
To make a global variable, you can do this to make $option
available outside functions.php
:
function func() {
global $option;
$option = get_option( 'simple_options' );
}
However, I cannot recommend it, since every other script may change the value. You can use a define:
define('MY_OPTION',get_option( 'simple_options' );
And in your footer:
echo MY_OPTION; // note that there are no quotation marks
But also this wouldn’t be that neat, since you’d have to make sure no other script defines this MY_OPTION
and you cannot change it later on.
No, your best bet is to get the option just again in your footer.