Title: Global variable?
Last modified: August 19, 2016

---

# Global variable?

 *  [JacoboPolavieja](https://wordpress.org/support/users/jacobopolavieja/)
 * (@jacobopolavieja)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/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.

## Tags

 * [global](https://wordpress.org/support/topic-tag/global/)
 * [variables](https://wordpress.org/support/topic-tag/variables/)

 * 0 replies
 * 1 participant
 * Last reply from: [JacoboPolavieja](https://wordpress.org/support/users/jacobopolavieja/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/global-variable/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
