Skip to content

Instantly share code, notes, and snippets.

@ryandonsullivan
Last active December 28, 2015 06:58
Show Gist options
  • Save ryandonsullivan/7460378 to your computer and use it in GitHub Desktop.
Save ryandonsullivan/7460378 to your computer and use it in GitHub Desktop.
WHY? WHYYYY???
<?php
//don't use (deregister) WP's jQuery version
wp_deregister_script( 'jquery' );
//Use jQuery from Google Code
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js');
//Include one of my custom javascript files
wp_register_script( 'uiwidget', get_template_directory_uri().'/style/js/jquery.ui.widget.min.js', 'jquery', '1.0');
wp_register_script( 'audio', get_template_directory_uri().'/style/js/AudioPlayerV1.js', 'jquery', '1.1.3');
wp_register_script( 'menu', get_template_directory_uri().'/style/js/superfish.js', 'jquery', '1.4.8');
wp_register_script( 'hover', get_template_directory_uri().'/style/js/jquery.hoverIntent.js', 'jquery', '1.0');
wp_register_script( 'selectnav', get_template_directory_uri().'/style/js/selectnav.js', 'jquery', '0.1');
wp_register_script( 'jtools', get_template_directory_uri().'/style/js/jquery.tools.min.js', 'jquery', '1.2.5');
wp_register_script( 'fitvids', get_template_directory_uri().'/style/js/jquery.fitvids.js', 'jquery', '1.0');
wp_register_script( 'flex', get_template_directory_uri().'/style/js/jquery.flexslider-min.js', 'jquery', '1.8');
wp_register_script( 'fancybox', get_template_directory_uri().'/style/js/jquery.fancybox.pack.js', 'jquery', '2.0.6');
wp_register_script( 'buttons', get_template_directory_uri().'/style/js/fancybox/helpers/jquery.fancybox-buttons.js', 'jquery', '1.0.2');
wp_register_script( 'thumbs', get_template_directory_uri().'/style/js/fancybox/helpers/jquery.fancybox-thumbs.js', 'jquery', '1.0.2');
wp_register_script( 'media', get_template_directory_uri().'/style/js/fancybox/helpers/jquery.fancybox-media.js', 'jquery', '1.0.0');
wp_register_script( 'forms', get_stylesheet_directory_uri().'/style/js/jquery.slickforms.js', 'jquery', '1.0');
wp_register_script( 'scripts', get_template_directory_uri().'/style/js/scripts.js', 'jquery', '1.0');
wp_register_script( 'masonry', get_template_directory_uri().'/style/js/jquery.masonry.min.js', 'jquery', '2.1.05');
wp_register_script( 'dribbble', get_template_directory_uri().'/style/js/jquery.jribbble-0.11.0.ugly.js', 'jquery', '0.11');
wp_register_script( 'flickr', get_template_directory_uri().'/style/js/jquery.dcflickr.1.0.js', 'jquery', '1.0');
wp_register_script( 'engage', get_template_directory_uri().'/style/js/engage.js', 'jquery', '1.0');
wp_enqueue_script('jquery');
wp_enqueue_script('uiwidget');
wp_enqueue_script('audio');
wp_enqueue_script('menu');
wp_enqueue_script('selectnav');
wp_enqueue_script('hover');
wp_enqueue_script('jtools');
wp_enqueue_script('fitvids');
wp_enqueue_script('flex');
wp_enqueue_script('fancybox');
wp_enqueue_script('buttons');
wp_enqueue_script('thumbs');
wp_enqueue_script('media');
wp_enqueue_script('forms');
wp_enqueue_script('scripts');
if(is_page_template('template-dribbble.php')):
wp_enqueue_script('masonry');
wp_enqueue_script('dribbble');
endif;
if(is_page_template('template-flickr.php')):
wp_enqueue_script('masonry');
wp_enqueue_script('flickr');
endif;
if(is_page_template('template-gallery.php')):
wp_enqueue_script('masonry');
endif;
if(is_page_template('template-lastfm.php')):
wp_enqueue_script('engage');
endif;
}
add_action('wp_enqueue_scripts', 'load_my_scripts');
?>
@JPry
Copy link

JPry commented Nov 14, 2013

What theme is this from?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment