Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
wp_enqueue_script('jquery-effects-shake');

..doesn't seem to work, no matter where I put it. I've tried the following and lots of googling:

function my_callback() {
    wp_enqueue_script('jquery-effects-shake');
}
add_action('wp_enqueue_scripts', 'my_callback');

and

<?php
    wp_enqueue_script('jquery-effects-shake');
    get_header(); 
?>

Thanks!

share|improve this question
    
Related: How Do I Use jQuery UI In My Plugin –  toscho Oct 18 '13 at 23:46
    
What does "doesnt work" mean? Have you viewed source to see if the script loads? Or are you saying you can't make a script shake (which could be a whole boatload of other problem) –  cale_b Oct 19 '13 at 3:15
    
It isn't adding the script to <head>. –  patrickkidd Oct 19 '13 at 18:53
    
toscho: That is one of the docs that I read. I am doing the same thing and it's still not adding the script to <head> –  patrickkidd Oct 19 '13 at 18:55
    
Is the theme using the wp_head and wp_footer function calls? You said it's not loading in <head>, does that mean it's loading somewhere else or not at all? –  morganestes Oct 25 '13 at 3:31
add comment

1 Answer 1

Make sure you are also including the jquery effects core... and jquery if it's not already being loaded.

function my_callback() {
    wp_enqueue_script('jquery');  // If not already loaded
    wp_enqueue_script('jquery-effects-core');
    wp_enqueue_script('jquery-effects-shake');
}
add_action('wp_enqueue_scripts', 'my_callback');
share|improve this answer
    
Shouldn't those be automatically included as Dependencies? Adding them made no difference for me. –  patrickkidd Oct 19 '13 at 18:53
    
Are you trying to do this in the admin panel, or in a template file for the front-end of the site? –  josh Oct 19 '13 at 19:15
    
In a template on the front-end of the site. –  patrickkidd Oct 22 '13 at 20:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.