WordPress eats my defined variables?
I use some external PHP I’ve written (that is not really a plugin) to read some files and do various things. Its configuration is stored in a file called config.php. config.php is just a PHP file containing a set of variable assignments in the form:
$INFO[‘setting’] = ‘thevalue’;
Then, I pick up those variables at various parts throughout my page and act upon them.
However, here is the issue. I cannot include the config.php file any earlier than the get_header(); call in /wp-content/themes/thetheme/index.php. If I do, then mysteriously my variables are wiped.
For example, if I include config.php after the get_header() call, $INFO[‘name’] == ‘Seth’.
If I include the file before this call, perhaps in the file header.php, $INFO[‘name’] === NULL!
Please help me solve this frustrating problem 🙁
- The topic ‘WordPress eats my defined variables?’ is closed to new replies.