wordpress set global variables code example
Example: wordpress global variable not working
global $g_value;
//declare it global even before assigning it., this should fix it.
$g_value = 'something';
echo $g_value;
function get_value() {
global $g_value;
print $g_value;
}
echo get_value();