How to correctly include jquery-ui effects on wordpress

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");

Leave a Comment