Forums

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

Home Forums Other Can’t get jquery to load in my WordPress theme. Please help.

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #24627
    w1cky
    Member

    It’s driving me nuts!
    This is what I’ve got in my theme header.php:

    Code:

    But doesn’t seem to work?!

    Is there anyway to test if the jQuery library is loaded… something equivalent to phpinfo.php ?

    #56491
    apostrophe
    Participant

    I always use the google hosted version and never have a problem. Just add this to your header before you call your js file:

    Code:
    #56502
    Chris Coyier
    Keymaster

    Really looks like you got that correct. Live link would be the only way we could see what’s going on and help.

    #56513
    pab
    Member

    you can try this

    <script type="text/javascript" src="<?php bloginfo(‘template_directory’); ?>/js/jquery.js"></script>

    #56535
    w1cky
    Member
    "chriscoyier" wrote:
    Really looks like you got that correct. Live link would be the only way we could see what’s going on and help.

    It’s still on my dev server at the mo.

    Actually after a bit more testing it turns out that the lib is loading and the problem appears to be with the jQuery plugins that I’m using (or maybe how they’re called). Some work and some don’t in WP, but all work in static test HTML.

    Example:

    To try and get my head ’round jQuery, I’ve followed this tut:
    http://net.tutsplus.com/tutorials/javas … esomeness/

    It work’s fine in a straight HTML page, so now I’m trying to use it with WP.

    In WP I’ve got the following immediately before </head>:

    Code:

    I also tried enqueueing the "bettertooltip.js" after jquery ( before the wp_head(); ), but that doesn’t work either. Like this:

    Code:

    Thanks for the feedback so far, much appreciated!

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