![]() |
PHP - Wordpress - Global Variables Ok, I want to set in the functions.php that $X = Y so throughout the rest of my theme I can simply echo $X Also, I have a lot of variables that are set through the themes option page so it needs to work for multiple variables. How do I do this coolness? |
Re: PHP - Wordpress - Global Variables OK, solved this little issue. Apparently wordpress doesn't carry over global variables into the header, footer, sidebar etc... which is why I was running into problems. I was testing out my code in the header. Silly me. |
Re: PHP - Wordpress - Global Variables The globals variables is not WordPress behavior its PHPs default behavior. If you are doing theme options etc Chip Bennet has a great tutorial on the subject. Incorporating the Settings API in WordPress Themes ยป cb.blog Do as he writes and your theme will be better than most. But you should avoid globals and try to move over to PHP 5. |
Re: PHP - Wordpress - Global Variables How did you solve it though? |
| All times are GMT -6. The time now is 10:35 PM. |