Merge branch 'master' into grunt
This commit is contained in:
@@ -80,6 +80,20 @@ function roots_language_attributes() {
|
||||
}
|
||||
add_filter('language_attributes', 'roots_language_attributes');
|
||||
|
||||
/**
|
||||
* Manage output of wp_title()
|
||||
*/
|
||||
function roots_wp_title($title) {
|
||||
if (is_feed()) {
|
||||
return $title;
|
||||
}
|
||||
|
||||
$title .= get_bloginfo('name');
|
||||
|
||||
return $title;
|
||||
}
|
||||
add_filter('wp_title', 'roots_wp_title', 10);
|
||||
|
||||
/**
|
||||
* Clean up output of stylesheet <link> tags
|
||||
*/
|
||||
@@ -128,7 +142,7 @@ function roots_root_relative_url($input) {
|
||||
if(!is_admin() && site_url() != home_url() && stristr($input, 'wp-includes') === false) {
|
||||
$input = str_replace(site_url(), "", $input);
|
||||
}
|
||||
|
||||
|
||||
$output = preg_replace_callback(
|
||||
'!(https?://[^/|"]+)([^"]+)?!',
|
||||
create_function(
|
||||
@@ -142,7 +156,7 @@ function roots_root_relative_url($input) {
|
||||
),
|
||||
$input
|
||||
);
|
||||
|
||||
|
||||
// detect and correct for subdir installs
|
||||
if($subdir = parse_url(home_url(), PHP_URL_PATH)) {
|
||||
if(substr($output, 0, strlen($subdir)) == (substr($output, strlen($subdir), strlen($subdir)))) {
|
||||
|
||||
@@ -8,6 +8,7 @@ add_theme_support('h5bp-htaccess'); // Enable HTML5 Boilerplate's .htacc
|
||||
add_theme_support('bootstrap-top-navbar'); // Enable Bootstrap's top navbar
|
||||
add_theme_support('bootstrap-gallery'); // Enable Bootstrap's thumbnails component on [gallery]
|
||||
add_theme_support('nice-search'); // Enable /?s= to /search/ redirect
|
||||
add_theme_support('jquery-cdn'); // Enable to load jQuery from the Google CDN
|
||||
|
||||
/**
|
||||
* Configuration values
|
||||
|
||||
@@ -38,7 +38,7 @@ class Roots_Nav_Walker extends Walker_Nav_Menu {
|
||||
}
|
||||
|
||||
function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output) {
|
||||
$element->is_dropdown = !empty($children_elements[$element->ID]);
|
||||
$element->is_dropdown = ((!empty($children_elements[$element->ID]) && (($depth + 1) < $max_depth)));
|
||||
|
||||
if ($element->is_dropdown) {
|
||||
if ($depth === 0) {
|
||||
|
||||
@@ -22,9 +22,10 @@ function roots_scripts() {
|
||||
// jQuery is loaded using the same method from HTML5 Boilerplate:
|
||||
// Grab Google CDN's latest jQuery with a protocol relative URL; fallback to local if offline
|
||||
// It's kept in the header instead of footer to avoid conflicts with plugins.
|
||||
if (!is_admin()) {
|
||||
if (!is_admin() && current_theme_supports('jquery-cdn')) {
|
||||
wp_deregister_script('jquery');
|
||||
wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', false, null, false);
|
||||
add_filter('script_loader_src', 'roots_jquery_local_fallback', 10, 2);
|
||||
}
|
||||
|
||||
if (is_single() && comments_open() && get_option('thread_comments')) {
|
||||
@@ -54,9 +55,6 @@ function roots_jquery_local_fallback($src, $handle) {
|
||||
|
||||
return $src;
|
||||
}
|
||||
if (!is_admin()) {
|
||||
add_filter('script_loader_src', 'roots_jquery_local_fallback', 10, 2);
|
||||
}
|
||||
|
||||
function roots_google_analytics() { ?>
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user