Support » Themes and Templates » enqueue jQuery Accordion scripts

enqueue jQuery Accordion scripts

  • I have 3 jQuery accordion scripts that live in my content theme in /jquery-ui/js/

    jquery-ui-1.10.3.custom.js, jquery-1.9.1.js, ux.js

    They work when hardcoded in header. Having trouble enqueuing them.

    functions file

    function jqueryAccordion () {
       wp_register_script ('accordion', get_template_directory_uri() . '/jquery-ui/js/', array('jquery-ui-1.10.3.custom.js', 'jquery-1.9.1.js','ux.js') );
       wp_enqueue_script( 'accordion', get_template_directory_uri() . '/jquery-ui/js/', array('jquery-ui-1.10.3.custom.js', 'jquery-1.9.1.js','ux.js') );
    add_action('init', 'jqueryAccordion');

Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi


    Forum Moderator

    Do not enqueue extra copies of jQuery. WordPress allready ships with jQuery 1.10.x

    ux.js has modest modification to the doc model. EIther way the syntax (or something else i’m doing is wrong) and not working. I know the scripts are fine b/c they work hardcoded. So it’s how i’m implementing enqueue.
    I thought if i put it in a function file it would get called before the header and work which from what i saw on some posts was the problem. As is written scripts just arent’ being called… am i supposed to implement this somewhere else… template itself just uses div accordion which works when hardcoded.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘enqueue jQuery Accordion scripts’ is closed to new replies.