• Resolved sicdigital

    (@mac974)


    Hello everyone, I’ve been searching on how to do this but I just can’t seem to get it working. I have a config.php file inside the main directory of my wordpress installation. Basically I have this config file full of variables that I would like to apply to all my pages. So that when I change the site I can just change the one config file to replace names etc. I’m using php exec to echo the variables where I need them but it’s not working.

    The config looks like this…

    $config['fname'] = "Bob";
    $config['lname'] = "Smith";

    etc…

    I’ve tried using an include in the header for the file but it’s not working and I don’t know what I’m doing wrong. Seems simple enough but I’m kind of a newb and I don’t know what I’m missing.

Viewing 2 replies - 1 through 2 (of 2 total)
  • MichaelH

    (@michaelh)

    Look at wp-config.php and how it DEFINEs variable. Don’t know a reason why couldn’t just put your variables in wp-config.php along with the other things…

    Thread Starter sicdigital

    (@mac974)

    thanks! it worked

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Passing variables in to wordpress pages’ is closed to new replies.