Skip to content

Instantly share code, notes, and snippets.

@fieke
Created September 18, 2013 07:08
Show Gist options
  • Save fieke/6605542 to your computer and use it in GitHub Desktop.
Save fieke/6605542 to your computer and use it in GitHub Desktop.
Bug Google analytics -> Basetheme
function basetheme_preprocess_html(&$vars) {
$vars['theme_folder'] = base_path() . path_to_theme();
// Function to cleanup html source a bit more
function indent($string) {
$spacing = " ";
$string = ltrim(str_replace('<link', $spacing . '<link', $string));
$string = ltrim(str_replace('<meta', $spacing . '<meta', $string));
$string = ltrim(str_replace('<script', $spacing . '<script', $string));
// $string = str_replace($_SERVER['HTTP_HOST'], '', $string);
// $string = str_replace('http://', '', $string);
return $string;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment