Multiple PHP snippets not working
-
Hi,
I have PHP snippets like this:
include get_stylesheet_directory() . '/inc/prices.php'; echo getMoneyUS($us21);
It shows the price that is listed in prices.php. Having a single snippet on a page works fine. Having a second snippet with the same code, just a different price call, either breaks the page, or it shows $0.00 for the second one. The break happens if I use INCLUDE in both snippets. Using INCLUDE_ONCE or no INCLUDE at all in the second one produces $0.00.
This code works fine in my static HTML pages.
Now, seeing $0.00 tells me that my monetary function works fine, but why the code in the snippet does not read the prices.php for the second one, that is something I cannot figure. The variable is there. Plus, the first price is shown correctly.Thanks
- The topic ‘Multiple PHP snippets not working’ is closed to new replies.