How can I add a global variable accessible by my theme? (2 posts)

  1. gendem
    Posted 6 years ago #

    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;

    Is there some other way to achieve this?


  2. Ryan Hellyer
    Posted 6 years ago #

    The rand() PHP function can do that:


Topic Closed

This topic has been closed to new replies.

About this Topic