| | #1 |
| I'm Kind Of A Big Deal Join Date: 2009
Posts: 1,997
Thanks: 58
Thanked 417 Times in 307 Posts
|
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? |
|
I'm all about that bass.
| |
| |
| | #2 |
| I'm Kind Of A Big Deal Join Date: 2009
Posts: 1,997
Thanks: 58
Thanked 417 Times in 307 Posts
|
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. |
|
I'm all about that bass.
| |
| |
| | #3 |
| Programmer of Awesomeness War Room Member Join Date: 2009 Location: Sweden
Posts: 164
Thanks: 9
Thanked 12 Times in 12 Posts
|
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. |
| Excellent product, Excellent support, great for affiliate marketers (Amazon, ClickBank etc) http://andreasnurbo.com [SIGPIC][/SIGPIC] | |
| |
| | #4 |
| Warrior Member Join Date: 2011
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
How did you solve it though?
|
| |
|
| Bookmarks |
| Tags |
| global, php, variables, wordpress |
| |