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.

1 Answer 1


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;
  • 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, 2012 at 9:39
  • using <?php include('options.php'); ?> at every template file solves my problem.
    – seoppc
    Jun 13, 2012 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, 2012 at 10:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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