Advertisement
dominornovus

Enqueue jQuery UI selectmenu

Sep 5th, 2012
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.00 KB | None | 0 0
  1. //http://wordpress.stackexchange.com/questions/64062/cannot-enqueue-jquery-correctly-using-google-cdn
  2. //http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Load_a_default_WordPress_script_from_a_non-default_location
  3.  
  4. function my_scripts_method() {
  5.     wp_deregister_script( 'jquery' );
  6.     wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.12/jquery.min.js');
  7.     wp_enqueue_script( 'jquery' );
  8.     wp_enqueue_style( 'uicss', '(path_ to_script_location)/my-custom-style.css' );    
  9.     wp_enqueue_script( 'uisel', 'http://jquery-ui.googlecode.com/svn/branches/labs/selectmenu/ui.selectmenu.js' );
  10.     wp_enqueue_style( 'uicss2', 'http://jquery-ui.googlecode.com/svn/branches/labs/selectmenu/ui.selectmenu.css' );
  11.     wp_enqueue_script( 'uiease', '(path_ to_script_location)/jquery.easing.1.3.js' );
  12. }    
  13.  
  14. //add_action('wp_enqueue_scripts', 'my_scripts_method'); // selectmenu would not work targeting wp_enqueue_scripts
  15. add_action('wp_head', 'my_scripts_method');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement