WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using word press theme option panel and using those in my header.php without any issues, code as follows...

    // loading theme options.  used in header.php
    global $options;
    foreach ($options as $value) {
        if (get_settings( $value['id'] ) === FALSE) { 
            $$value['id'] = $value['std']; 
        } else { 
            $$value['id'] = get_settings( $value['id'] ); 

<?php echo $aagt_fb_url; ?> //loads fb url

But if i use <?php echo $aagt_fb_url; ?> in index.php it doesn't work, can you please help me to resolve this issue. thanks.

share|improve this question
up vote 0 down vote accepted

If you are using some custom global theme options, I’d set them in functions.php. Then you access them from any template if you declare them global first.

// functions.php
$aagt_fb_url = 'foo';


// template file like header.php, index.php, etc.
global $aagt_fb_url;
echo $aagt_fb_url;
share|improve this answer
thanks, if i paste options functions to retrieve values in functions.php, it doesn't work after using global $aagt_fb_url; echo $aagt_fb_url; – seoppc Jun 13 '12 at 9:39
using <?php include('options.php'); ?> at every template file solves my problem. – seoppc Jun 13 '12 at 9:58
Okay, to avoid having to include that file in every template maybe you could make $GLOBALS work for you? – Geert Jun 13 '12 at 10:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.