• I’m working on a theme I inherited and the jQuery is not recognized halfway down the page. It is included in the head and works before that, but when I add it to a certain theme file I get “$ is not a function”. I’m not that familiar with how a theme is supposed to be set up and I’m just troubleshooting this one, so any information or advice on this would be good. Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Thread Starter davehprohoods

    (@davehprohoods)

    This is good, but it’s not in a Post, just in a theme file, and Javascript works, but jQuery doesn’t even though it’s included successfully in the head.

    Would WordPress prevent one of the theme files (which is actually a template) from running jQuery but not Javascript? I think I’m missing something on understanding on how it puts the page together somewhere.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    but jQuery doesn’t even though it’s included successfully in the head.

    If you’ve added this then remove it. jQuery is already included by WordPress.

    Would WordPress prevent one of the theme files (which is actually a template) from running jQuery but not Javascript?

    Sure, you have to use jQuery in particular circumstances like with noconflict wrappers when dealing with WordPress.

    If you are using javascript in a theme file, then you should be enqueueing it as mentioned on the page linked to above.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘jQuery not recognized halfway down the page’ is closed to new replies.