The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Clarifying question – bringing jquery into WP?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #25819

    Hi everyone,

    I was just curious on the method of bringing in jQuery into WP themes.

    When you use <?php wp_enqueue_script("jquery"); ?> before <?php wp_head(); ?>, are you pretty much calling any .js file that is sitting in the directory, or does it just load the basic default functions that come with jQuery’s library?

    In other words, when I use enqueue, and I’m using a custom jQuery script, do I have to manually load that in addition to enqueue? Or is that included in the enqueue process and I just drop the custom .js file into the WP directory that contains the jQuery scripts?

    Chris Coyier

    You don’t need to do anything else. Those two calls will load jQuery on your page, and indeed is the correct way to do it. WordPress ships with a copy of jQuery, and that’s what it will load.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.