Created
September 18, 2013 07:08
-
-
Save fieke/6605542 to your computer and use it in GitHub Desktop.
Bug Google analytics -> Basetheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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