Load $variables from other template
-
Hi,
I`m trying to load a variable from another template, but it won’t work. I Googled around, but i couldn’t find an answer, so i really need your help!
This what i try to do for example:
Templatefile-array.php <?php $fruit = 'apple'; ?> Templatefile-load-array.php <?php locate_template('Templatefile-array.php', true);?> <?php echo $fruit;?>The expected outcome would be ‘apple’.
But nothing shows up….
It normally works fine in PHP.Can someone please tell me how to solve this?
Thanks!Kind Regards,
Yourit
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Load $variables from other template’ is closed to new replies.