function thematic_googleanalytics()
{
    global $my_shortname;
    $ga = stripslashes(get_option($my_shortname . '_googleanalytics'));
    if ($ga == 'YOAST') {
        // yoast ga needs to be in the header
        yoast_analytics();
        return;
    }
    if (!$ga || $ga == 'false') {
        return;
    }
    ?>

		<!-- BEGIN thematic_googleanalytics -->
		<script>
			var _gaq = [['_setAccount', '<?php 
    echo $ga;
    ?>
'], ['_trackPageview']];
			(function(d, t) {
			var g = d.createElement(t),
			    s = d.getElementsByTagName(t)[0];
			g.async = true;
			g.src = '//www.google-analytics.com/ga.js';
			s.parentNode.insertBefore(g, s);
			})(document, 'script');
		</script>
		<!-- END thematic_googleanalytics -->

<?php 
}
예제 #2
0
<!DOCTYPE html>
<html <?php 
language_attributes();
?>
>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1 user-scalable=no">
	<title><?php 
wp_title('');
?>
</title>
	<link rel="pingback" href="<?php 
bloginfo('pingback_url');
?>
">
	<?php 
if (function_exists('yoast_analytics')) {
    yoast_analytics();
}
wp_head();
?>
</head>
<body <?php 
body_class();
?>
>
	<div class="holder">
		<div class="wrapper">