I’ve been trying to include the jquery ui effects (more specifically the shake effect) on my wordpress theme. So far, I’ve only been able to include the jQuery script, but I really have no clue where to place the ui scripts and how to enqueue them.
This is the code I have. It obviously doesnt work:
Thanks for your help!
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.