Global variable?
-
Hello all again!
Is there a way to access a variable globally? I have a news site were we have each new with a country they belong to. We need to display them by regions (USA, Europe, Resto of the world) in various pages.
So I was wondering… is there a way to define a global variable and make it available to all my wordpress functions?
I’d like to define a 2 dimension array with the three regions and then on each subarray the list of countries that belong to that region. Example
– USA
– Europe
— Spain
— France
— Italy
— Greece
….
– World
— Argentina
— Brazil
— China
….So that when I need to display a region’s news I can do something like grabng all the news and say “if it’s in this region’s subarray then show, if not don’t”.
Is it possible? Do you find a better way to achieve this?
Thanks a lot!
- The topic ‘Global variable?’ is closed to new replies.