From 267e24e9a3060b5a2bda67641cfc74eb8384c0fa Mon Sep 17 00:00:00 2001 From: Scott Walkinshaw Date: Wed, 19 Sep 2012 13:53:01 -0400 Subject: [PATCH] Move Google Analytics code into footer template Once again, HTML tags should be in the templates when possible. actions.php is no longer needed now as well. --- functions.php | 1 - lib/actions.php | 20 -------------------- templates/footer.php | 11 ++++++++++- 3 files changed, 10 insertions(+), 22 deletions(-) delete mode 100644 lib/actions.php diff --git a/functions.php b/functions.php index 6d0a540..1579ec3 100644 --- a/functions.php +++ b/functions.php @@ -12,7 +12,6 @@ require_once locate_template('/lib/cleanup.php'); // Cleanup require_once locate_template('/lib/htaccess.php'); // Rewrites for assets, H5BP .htaccess require_once locate_template('/lib/widgets.php'); // Sidebars and widgets require_once locate_template('/lib/template-tags.php'); // Template tags -require_once locate_template('/lib/actions.php'); // Actions require_once locate_template('/lib/scripts.php'); // Scripts and stylesheets require_once locate_template('/lib/post-types.php'); // Custom post types require_once locate_template('/lib/metaboxes.php'); // Custom metaboxes diff --git a/lib/actions.php b/lib/actions.php deleted file mode 100644 index d7a82f3..0000000 --- a/lib/actions.php +++ /dev/null @@ -1,20 +0,0 @@ -\n"; - echo "\t\tvar _gaq=[['_setAccount','" . GOOGLE_ANALYTICS_ID . "'],['_trackPageview']];\n"; - echo "\t\t(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];\n"; - echo "\t\tg.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';\n"; - echo "\t\ts.parentNode.insertBefore(g,s)}(document,'script'));\n"; - echo "\t\n"; - } -} - -add_action('wp_footer', 'roots_google_analytics'); diff --git a/templates/footer.php b/templates/footer.php index 4f293cd..c6b9db7 100644 --- a/templates/footer.php +++ b/templates/footer.php @@ -3,4 +3,13 @@

©

- \ No newline at end of file + + + + +