Advertisement
grappler

Load child theme script

Jan 21st, 2013
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.65 KB | None | 0 0
  1. <?php
  2.     /**
  3.      * A safe way of removing JavaScripts to a WordPress generated page.
  4.      */
  5.     if (!is_admin())
  6.         add_action('wp_enqueue_scripts', 'responsive_js');
  7.  
  8.     if (!function_exists('responsive_js')) {
  9.  
  10.         function responsive_js() {
  11.             // JS at the bottom for fast page loading.
  12.             // except for Modernizr which enables HTML5 elements & feature detects.
  13.             wp_dequeue_script('modernizr', get_template_directory_uri() . '/js/responsive-modernizr.js', array('jquery'), '2.6.1', false);
  14.             wp_dequeue_script('responsive-scripts', get_template_directory_uri() . '/js/responsive-scripts.js', array('jquery'), '1.2.1', true);
  15.             wp_dequeue_script('responsive-plugins', get_template_directory_uri() . '/js/responsive-plugins.js', array('jquery'), '1.1.1', true);
  16.         }
  17.  
  18.     }
  19. ?>
  20. <?php
  21.     /**
  22.      * A safe way of adding JavaScripts to a WordPress generated page.
  23.      */
  24.     if (!is_admin())
  25.         add_action('wp_enqueue_scripts', 'responsive_child_js');
  26.  
  27.     if (!function_exists('responsive_child_js')) {
  28.  
  29.         function responsive_child_js() {
  30.             // JS at the bottom for fast page loading.
  31.             // except for Modernizr which enables HTML5 elements & feature detects.
  32.             wp_enqueue_script('modernizr-child', get_stylesheet_directory_uri() . '/js/responsive-modernizr.js', array('jquery'), '2.6.1', false);
  33.             wp_enqueue_script('responsive-child-scripts', get_stylesheet_directory_uri() . '/js/responsive-scripts.js', array('jquery'), '1.2.1', true);
  34.             wp_enqueue_script('responsive-child-plugins', get_stylesheet_directory_uri() . '/js/responsive-plugins.js', array('jquery'), '1.1.1', true);
  35.         }
  36.  
  37.     }
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement