Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Correct method for adding jQuery UI selectmenu to WordPress.

By: dominornovus on Sep 6th, 2012  |  syntax: PHP  |  size: 0.90 KB  |  views: 155  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // Upload jquery.ui.selectmenu.js and jquery.ui.selectmenu.css to your theme directory. Both files can be found at: https://github.com/fnagel/jquery-ui.
  2. // Add this the following function to your functions.php file.
  3.  
  4. function my_scripts_method() {
  5.     // Load the UI core which loads jQuery as a dependency.
  6.     wp_enqueue_script("jquery-ui-core");
  7.     // Load UI theme.
  8.     wp_enqueue_style( 'uicss', '(paste the path of wherever you uploaded your files to here)/custom-theme.css' );  
  9.     // Load script for selectmenu.
  10.     wp_enqueue_script( 'uisel1', '(paste the path of wherever you uploaded your files to here)/jquery.ui.selectmenu.js' );
  11.     // Load CSS for selectmenu.
  12.     wp_enqueue_style( 'uicss2', '(paste the path of wherever you uploaded your files to here)/jquery.ui.selectmenu.css' );
  13. }    
  14.  
  15. //add_action('wp_enqueue_scripts', 'my_scripts_method');
  16. add_action('wp_head', 'my_scripts_method');