I'm in the prcoess of setting up my (Wordpress) solution on a new production server. I now discovere that the PHP function define is not working.
I have this line of code in my functions.php:
define('INCLUDE_DIR', $_SERVER['DOCUMENT_ROOT'] . '/wp-content/themes/storelocator/include/');
Testing the following code:
if (!defined('INCLUDE_DIR'))
echo ' NOT SET! ';
outputs NOT SET.
According to this page, I'm using constant correct in the include statement.
The rest of the code in functions.php is running fine. I've checked.
Is this due to some PHP configuration? I'm using PHP v5.3.8
UPDATE:
define() is at the very top of functions.php file.
The if statement is at the very top of some-file.php.
I'm pretty sure functions.php is run before some-file.php.
UPDATE
It seems that I got this error because I had empty lines at the bottom of my PHP files. I removed the empty lines and now it seems to work :-/
functions.phpis run before any other WP template file, right? Sofunctions.phpshould run before 'some.template.php` file where I useddefined().functions.phpis automatically run by Wordpress before any other template files are loaded.