Reputation: 69
I am currently putting in php code in my wordpress footer. For example,
$a = "Hi";
and on my wordpress page i try to echo $a;
but only get blank and not "Hi. Is there a way to solve this? P.s I am usuing WordPress's admin dashboard
Any help would be appreciated
Thanks
Upvotes: 0
Views: 112
Reputation: 2249
Variables are not passed between template files (header, footer, etc.). You can make it global.
global $a;
And then echo it. Also note the order : if get_footer(); si called after, then you can't echo it before...
Upvotes: 2