Get the site base url in template.php How do i get the base url in template.php? 

None of the below works.

global $base_url;
global $base_path;
global $base_root;
You can use the base_path() function which should always work.

To be honest though it just returns $GLOBALS['base_path'] so your global $base_path statement should work fine.