• Apologies for the long title.

    Basically I just want to know why when I define a variable in functions.php it can’t be accessed in header.php etc unless I globalize the variable inside header.php first.

    Functions I define can be ran no problem, but variables have the value NULL (unless globalized).

    I’m newish to theme dev so was wondering if it’s always been like that, if so why, and can anyone suggest an alternative to making a variable accessable to the entire theme.

    Thanks for any help.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Variables defined in functions.php not accessable elsewhere’ is closed to new replies.