WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using a carousel to display latest jposts on my front page and I am using the following code but it's not working.

function my_load_caroufredsel() {
        // Enqueue carouFredSel, note that we specify 'jquery' as a dependency, and we set 'true' for loading in the footer:
        wp_register_script( 'caroufredsel', get_template_directory_uri() . '/js/jquery.carouFredSel-6.1.0-packed.js', array( 'jquery' ), '6.1.0', true );
        // For either a plugin or a theme, you can then enqueue the script:
        wp_enqueue_script( 'my-caroufredsel', get_template_directory_uri() . '/js/my-caroufredsel.js', array( 'caroufredsel' ), '', true );
    add_action( 'wp_enqueue_scripts', 'my_load_caroufredsel' );

Any one can please tell what's the problem with the above code. Thanks

share|improve this question

You only register your first script, but don't enqueue it. Change wp_register_script to wp_enqueue_script and it should work. Registering it is useful if you may possibly enqueue it at different times/conditions, but in this case you can just enqueue it straight away.

share|improve this answer
Thanks for your reply. I have done it previously and have done again after your reminder but it's not working. – user1666698 Oct 20 '12 at 18:54
verify that your paths are all correct and the scripts exist where you're enqueueing them. – Milo Oct 20 '12 at 19:07
Actually I have a folder with the name js in my theme directory and both the scripts are here. So I think paths are correct. – user1666698 Oct 20 '12 at 19:09

Please make sure you are utilizing wp_head() and wp_footer() functions at appropriate places in your theme?

share|improve this answer

Your Answer


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.