WordPress 2.7 Emptying Global Variables Before Footer
-
I’ve confirmed this on multiple blogs of my own and also a friend tested it out on his 2.7 install:
global variables are not preserving through to the footer.php
In my case, I have the following code:
header.php
<?php global $cat39;?>
single.php
<?php if(in_category('39') ){ $cat39=1; }?>
<?php echo "test: " . $cat39;?>
footer.php
<?php echo "test: " . $cat39;?>
Now, I can confirm that in single.php the echoed value of $cat39 is 1. However, by the time you get to footer.php the echoed value is blank (empty, nothing).
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘WordPress 2.7 Emptying Global Variables Before Footer’ is closed to new replies.