Get the site base url in template.php

You can use the base_path() function.

for ex.

function mytheme_preprocess(&$vars) {
	$vars['second_logo'] = base_path() . 'sites/all/themes/mytheme/images/second_logo.png';
}

base_path code:

function base_path() {
  return $GLOBALS['base_path'];
}
Categories: Drupal Tags: , , , ,
%d bloggers like this: