I'm relatively new to WordPress development, and I'm trying to figure out how to make and use global variables in the `functions.php` file. I've been searching for a solution but haven't found one that suits my needs yet.
Here's what I'm specifically looking for: I want to create a global variable in the `functions.php` file that can be accessed from any other template file or even within other functions. Basically, I need a way to store and retrieve information that can be shared across multiple files.
I've tried declaring variables with the `global` keyword inside the `functions.php` file, but for some reason, they aren't accessible outside of that file. I'm not sure if I'm doing something wrong or if I'm missing a crucial step. Can someone please guide me on how to achieve this?
It would be great if you could provide me with an example of how to create a global variable in the `functions.php` file and then access it in a template file or another function.
Your help is much appreciated. Thank you in advance!