SHARE
TWEET

Correct method for adding jQuery UI selectmenu to WordPress.

dominornovus Sep 6th, 2012 244 Never
  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');
RAW Paste Data
Top