floridaflatlander Posted June 4, 2015 Share Posted June 4, 2015 I'm using a plugin to include a photo gallery on a wordpress site. At the bottom of the page in the footer I include <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> just like the samples I look at do it here http://getbootstrap.com/getting-started/#examples The problem is that the plugin doesn't work when I include jquery. I posted the probelm here https://wordpress.org/support/topic/huge-it-doesnt-work-with-google-ajax-jquery And the reply was jQuery should not be called this way. You try to call jQuery in no standard way, that's why it damages or jQuery and cause problems jQuery should not be called this way? That's the way the samples do it You try to call jQuery in no standard way? It's the same in every footer Sooo, how do you call jquery and what is the standard way? Thanks in advance Quote Link to comment Share on other sites More sharing options...
fastsol Posted June 4, 2015 Share Posted June 4, 2015 You can certainly call jquery in the manner you are. BUT it must be called BEFORE your plugin. Quote Link to comment Share on other sites More sharing options...
floridaflatlander Posted June 4, 2015 Author Share Posted June 4, 2015 Thanks fastsol I believe jquery is needed for the bootstrap menu and for hide divs to work although they seem to work without it. I use an if (is_page( 'gallery' )) to include it jquery in the header and (!(is_page())) to exclude it in the footer on the gallery page. Thanks again Quote Link to comment Share on other sites More sharing options...
maxxd Posted June 4, 2015 Share Posted June 4, 2015 The reply to your post on WordPress forum is probably due to the fact that this isn't the WordPress way of including the jQuery library. Also, check to make sure that WordPress isn't already including it. WP installs a local copy of jQuery in non-conflict mode in order to lessen the chances of conflicts when two different plugin developers use different libraries. You can always dequeue the WP version and enqueue the newer version, but be ware that it may actually break things. Like apparently Huge-it. WordPress is like that. Dequeue a script. Enqueue a script. Quote Link to comment Share on other sites More sharing options...
floridaflatlander Posted June 4, 2015 Author Share Posted June 4, 2015 Thanks maxxd, yes jquery is already included by my theme. Quote Link to comment Share on other sites More sharing options...
isabella_martin Posted June 19, 2015 Share Posted June 19, 2015 (edited) Add a jQuery link before the plugin link.Because your plugin needs jQuery functions and that are not defined that's why it shows an error on your web page. The best practise is always added jQuery before your plugins. Edited June 19, 2015 by isabella_martin Quote Link to comment Share on other sites More sharing options...
asianmartt Posted June 23, 2015 Share Posted June 23, 2015 The jQuery library is a single JavaScript file, and you reference it with the HTML <script> tag (notice that the <script> tag should be inside the <head> section First way Download the jQuery library from jQuery.com <head> <script src="jquery-1.11.3.min.js"></script> </head> Second way Include jQuery from a CDN, like Google <head><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script></head> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.