Czulu
Czulu

Reputation: 85

jQuery doesnt work in custom WordPress template

I'm making super simple theme for WordPress, and I've attached jQuery to it like this:

<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.js"></script>

And it shows in page source. But the thing is, plugins depending on jQuery don't work on my template and in Firebug console I get error TypeError: $(...).flexslider is not a function as if jQuery weren't loaded.

Upvotes: 0

Views: 119

Answers (2)

Czulu
Czulu

Reputation: 85

I was able to solve my issue by inserting jquery-dependent slideshow directly via template (with jquery linked above it in ) instead of by writing post containing shortcode. Perhaps it isnt most elegant solution but time was of the essence.

Upvotes: 0

Mike
Mike

Reputation: 1544

If I recall correctly, WordPress has issues with shorthand jQuery, so instead of $(...) you'd need to use jQuery(...). If it's the plugin that's trying to use it then you may have to modify the plugin. Pull the js off the server with FTP and do a simple find/replace (search for "$(" replace with "jQuery(").

Upvotes: 1

Related Questions