Browse files

Add jQuery CDN to theme features.

  • Loading branch information...
1 parent b7cd048 commit 6298ec18c73c2f255cb9f8e3b4068e4f4b706e14 @Foxaii Foxaii committed Mar 6, 2013
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/scripts.php
View
6 lib/scripts.php
@@ -27,9 +27,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')) {
@@ -61,9 +62,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>

0 comments on commit 6298ec1

Please sign in to comment.