• Hi,

    is there something new in the way WP deals with globals and what-not in 1.5?

    I have an app installed locally (in my server) which relies on variables set in one file to be read in another; pretty common, right?.

    So, I use a global declaration.

    It works in every other page that WP isn’t hooked up to.

    Any suggestions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Where do you put that global var? Try putting it in index.php of your theme.

    Thread Starter ph33rful

    (@ph33rful)

    I’m not sure what you mean, maybe it’s me. I’m just starting out with PHP programming.

    I have a function to write some info out to the HTML page. The function is kept in a seperate file and the variable in question is kept in a third file; both are included into the wordpress file.

    In the function I declare that my variable needs to be global but it’s doesn’t work: it doesn’t write out to the browser.

    As for index.php: it’s related to header information, so it’s in header.php.

    Thread Starter ph33rful

    (@ph33rful)

    yeah, nevermind. the include files ad to be called in index.php of wp, not the theme.

    sorry for the waste of time.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Global variables for an external application’ is closed to new replies.