Just a guess, but you might need to declare the list as global in your page.
Thanks for the response. I’m not sure what you mean, though.
Since I don’t know the exact coding of the PHP in your page, I can’t say for sure how to do this. Can you post the code that you used just after the body tag?
(Don’t try to post the code here unless it is 10 lines or less. Use a pastebin and post a link to it here if necessary)
It would also help to know the structure of the external document that you included in the header.
For example, prices.php looks like this:
<?php
$price_website_HomeSinglePage = '187';
$price_website_3pageIMsite = '350';
$price_website_3pagePersonal = '350';
$price_website_5pageBusiness = '550';
$price_website_WPbasic = '550';
?>
Then I call that into the WP theme’s header:
<?php include('includes/prices.php'); ?>
And then, in various posts and pages (using ‘Allow PHP’ plugin) I call individual prices like this:
[php] echo $price_website_5pageBusiness; [\php]
As for the tag under the body tag, that was regular PHP (below) and was strictly for testing, to make sure that prices.php was being called in, which it was.
<?php echo $price_website_5pageBusiness; ?>
I should also mention that I’m working strictly in the theme and posts, not in WP core code. I’m also not breaking any theme code.
Declaring the variable global might help:
[php] global $price_website_5pageBusiness; echo $price_website_5pageBusiness; [\php]
I thought that was insecure and that PHP had been updated to automatically make variables global. Am I confusing this with some other “global” topic?
Since everything displayed on a WordPress page is the result of a WordPress specific function, variables have to be declared global inside of the function that’s currently running to be used.