Files
sage/inc/roots-actions.php
Ben Word 3c3b71fac0 Remove all frameworks except Bootstrap (#251)
- Remove all frameworks except Bootstrap

- Remove roots-options.php and replace with a more simple
  roots-config.php

- Include all Bootstrap Javascript plugins by default in
  js/plugins.js

- Use Bootstrap Responsive and Topbar navigation by default

- Use Bootstrap markup on forms, page titles, image galleries,
  alerts and errors, post and comment navigation

- Remove Roots styles from style.css and introduce app.css for
  site-specific CSS. Remove almost all previous default Roots
  styles.

- Add latest updates from H5BP project
2012-02-03 12:10:44 -07:00

42 lines
1.4 KiB
PHP

<?php
add_action('roots_stylesheets', 'roots_get_stylesheets');
function roots_get_stylesheets() {
$styles = '';
$styles .= stylesheet_link_tag('/style.css', 1);
$styles .= stylesheet_link_tag('/bootstrap.css', 1);
if (BOOTSTRAP_RESPONSIVE) {
$styles .= stylesheet_link_tag('/bootstrap-responsive.css', 1);
}
$styles .= stylesheet_link_tag('/app.css', 1);
if (is_child_theme()) {
$styles .= "\t<link rel=\"stylesheet\" href=\"" . get_stylesheet_uri(). "\">\n";
}
echo $styles;
}
function stylesheet_link_tag($file, $tabs = 0, $newline = true, $rel = 'stylesheet') {
$indent = str_repeat("\t", $tabs);
return $indent . '<link rel="' . $rel .'" href="' . get_template_directory_uri() . '/css' . $file . '">' . ($newline ? "\n" : "");
}
add_action('roots_footer', 'roots_google_analytics');
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'],['_trackPageLoadTime']];\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";
}
}
?>