Including jquery UI in WordPress

Solution:1

You can tell the wp_enqueue_script() function that your scripts depend on jQuery, so they will be inserted in correct way and order, notice the third parameter, for example:

 wp_enqueue_script( 'jquery-ui-core', false, array('jquery'));

Read more here.

Also note that jQuery UI Effects is not included with the jquery-ui-core handle.

Solution:2

While WordPress does include the jQuery UI libraries, it does not include the UI/Effects library. That library is separate and standalone. You’ll need to include a copy of the effects.core.js file and enqueue it separately.

Note that you should name it jquery-effects-core when en-queuing it, for naming consistency.

You can include it like this:

wp_enqueue_script("jquery-effects-core",'http://example.com/whatever/effects.core.js', array('jquery'), '1.8.8');

Edit: This answer was written before WordPress 3.3, which now includes the various effects libraries as part of core. You can simply enqueue the pieces of the effects library that you need to use now.

The list of slugs for these files can be found in wp-includes/script-loader.php, but the core’s slug is jquery-effects-core.

wp_enqueue_script("jquery-effects-core");