I want to store one url variable in wordpress's main index.php and then access this variable in blog's sidebars, headers and posts. How to do this? For example http://www.abcxyz.com/index.php?show=yes Now I want to access this show variable in blog sidebar, header and posts? GCS
You'll need this to execute php in sidebars widgets and post content if you do not plan to edit the template files directly: http://wordpress.org/extend/plugins/exec-php/ Let's see. To grab the tagged parameter. Here's how I do it with WP Traffic Tools to grab the referring search query: $referrer= $_SERVER['HTTP_REFERER']; if (strstr($referrer,'google.com')||strstr($referrer,'bing.com')||strstr($referrer,'yahoo.com')||strstr($referrer,'q=')) { preg_match('/q=(.*?)(&|\z)/', $referrer,$matches); $google_query = $matches[1]; } PHP: That would need to go into the top of your theme's header.php file.