WordPress.org

Support

Support » Themes and Templates » How can I add a global variable accessible by my theme?

How can I add a global variable accessible by my theme?

  • Hi there

    Hopefully a simple question today. I have a theme that I want to set a few global variables in. Specifically, I want to generate a random number between x and y.

    I added the following to functions.php, but it seems not to have worked:

    global $QUOTE_MIN;
    global $QUOTE_MAX;
    
    $QUOTE_MIN=1;
    $QUOTE_MAX=9;

    Is there some other way to achieve this?

    …Mike

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How can I add a global variable accessible by my theme?’ is closed to new replies.