Re-organization
This commit is contained in:
23
inc/actions.php
Normal file
23
inc/actions.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
function roots_feed_link() {
|
||||
$count = wp_count_posts('post'); if ($count->publish > 0) {
|
||||
echo "\n\t<link rel=\"alternate\" type=\"application/rss+xml\" title=\"". get_bloginfo('name') ." Feed\" href=\"". home_url() ."/feed/\">\n";
|
||||
}
|
||||
}
|
||||
|
||||
add_action('roots_head', 'roots_feed_link');
|
||||
|
||||
function roots_google_analytics() {
|
||||
$roots_google_analytics_id = GOOGLE_ANALYTICS_ID;
|
||||
if ($roots_google_analytics_id !== '') {
|
||||
echo "\n\t<script>\n";
|
||||
echo "\t\tvar _gaq=[['_setAccount','$roots_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</script>\n";
|
||||
}
|
||||
}
|
||||
|
||||
add_action('roots_footer', 'roots_google_analytics');
|
||||
Reference in New Issue
Block a user