Comments on: 5 Tips For Using jQuery with WordPress http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/ Sun, 07 Mar 2010 21:17:38 +0000 http://wordpress.org/?v=2.9.2 hourly 1 By: Omer Greenwald http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/#comment-11630 Omer Greenwald Sun, 07 Mar 2010 21:17:38 +0000 http://www.ericmmartin.com/?p=832#comment-11630 Thanks Eric, integrating jQuery wisely with WordPress can have a lot of advantages especially if you use it selectively only for posts actually need jQuery. You can also add jQuery plugins easily to WordPress without installing WP plugins so your blog will load cleaner and faster. I wrote about it here http://www.webtechwise.com/add-jquery-to-wordpress-blog-without-plugins/ Thanks Eric, integrating jQuery wisely with WordPress can have a lot of advantages especially if you use it selectively only for posts actually need jQuery.
You can also add jQuery plugins easily to WordPress without installing WP plugins so your blog will load cleaner and faster.
I wrote about it here http://www.webtechwise.com/add-jquery-to-wordpress-blog-without-plugins/

]]>
By: 5 Cool Hacks and Tutorials Using WordPress and jQuery - WPConstructs.com http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/#comment-11623 5 Cool Hacks and Tutorials Using WordPress and jQuery - WPConstructs.com Sat, 06 Mar 2010 23:58:09 +0000 http://www.ericmmartin.com/?p=832#comment-11623 [...] 5 Tips For Using jQuery with WordPress [...] [...] 5 Tips For Using jQuery with WordPress [...]

]]>
By: Dennis Osorio http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/#comment-11607 Dennis Osorio Wed, 03 Mar 2010 22:39:35 +0000 http://www.ericmmartin.com/?p=832#comment-11607 Thank you so much for this. I was beginning to pull my hair out trying to get WP, jQuery, and Superfish to play nicely together. I looked at a bunch of other sites and got no where. Luckily I found your tips to be very clear & exactly what I was looking for. Note, I also found http://themocracy.com/2010/01/more-wordpress-and-jquery/ to be helpful with the suggestion to define the location of template directory in functions.php using something like <code>define(THEM_TEMPLATEURL, get_bloginfo('template_directory'));</code> Thank you so much for this. I was beginning to pull my hair out trying to get WP, jQuery, and Superfish to play nicely together.

I looked at a bunch of other sites and got no where. Luckily I found your tips to be very clear & exactly what I was looking for.

Note, I also found http://themocracy.com/2010/01/more-wordpress-and-jquery/ to be helpful with the suggestion to define the location of template directory in functions.php using something like

define(THEM_TEMPLATEURL, get_bloginfo('template_directory'));

]]>
By: Ken http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/#comment-11441 Ken Tue, 09 Feb 2010 19:18:50 +0000 http://www.ericmmartin.com/?p=832#comment-11441 About "Hacking": In the WordPress world, coding functions, using the APIs and writing plugins and themes are all considered "hacking". Hacking is not bad, and it's what you are supposed to do. The pop-culture reference to "hacking" is criminal behaivor black-hat hacking, and is different. There is nothing wrong with hacking WordPress. About "Hacking": In the WordPress world, coding functions, using the APIs and writing plugins and themes are all considered "hacking". Hacking is not bad, and it's what you are supposed to do. The pop-culture reference to "hacking" is criminal behaivor black-hat hacking, and is different. There is nothing wrong with hacking WordPress.

]]>
By: gorostas http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/#comment-11402 gorostas Fri, 05 Feb 2010 01:57:52 +0000 http://www.ericmmartin.com/?p=832#comment-11402 @ John: I like your idea, and I think something like this is needed somewhere in the footer: if (typeof jQuery == 'undefined') { // jQuery is not loaded : // document.open('local.jquery.path'); } else { // jQuery is loaded } for the part of loading the local copy I'm not sure.. refining needed here, but great post @ John:

I like your idea, and I think something like this is needed somewhere in the footer:

if (typeof jQuery == 'undefined') {
// jQuery is not loaded :
// document.open('local.jquery.path');
} else {
// jQuery is loaded
}

for the part of loading the local copy I'm not sure.. refining needed here, but great post

]]>
By: eddie http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/#comment-11346 eddie Fri, 29 Jan 2010 20:01:31 +0000 http://www.ericmmartin.com/?p=832#comment-11346 keep in mind that using wp_enqueue_script will cause jQuery to be loaded with every page, even pages that do not need jQuery. keep in mind that using wp_enqueue_script will cause jQuery to be loaded with every page, even pages that do not need jQuery.

]]>
By: John http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/#comment-11291 John Sat, 23 Jan 2010 23:54:49 +0000 http://www.ericmmartin.com/?p=832#comment-11291 Thanks for this post, I've referenced it several time since bookmarking it recently. I prefer to use Google's hosted jQuery but do you know of a way to load WP's copy of jQuery if for some reason the Google version doesn't load? Thanks, John Thanks for this post, I've referenced it several time since bookmarking it recently.

I prefer to use Google's hosted jQuery but do you know of a way to load WP's copy of jQuery if for some reason the Google version doesn't load?

Thanks,
John

]]>
By: Aliso the Geek http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/#comment-11272 Aliso the Geek Thu, 21 Jan 2010 04:31:55 +0000 http://www.ericmmartin.com/?p=832#comment-11272 [...] So if WordPress itself needs to load jQuery, or an additional plugin calls it in this way, then it’s only loaded once, and it’s loaded in no-conflict mode. This means that there won’t be two jQuery scripts of different versions competing for attention. And if you prefer an external reference to jQuery (such as the one from Google Code), there is a method for doing that in a WordPress-friendly way, too (see step 2 on this linked page). [...] [...] So if WordPress itself needs to load jQuery, or an additional plugin calls it in this way, then it’s only loaded once, and it’s loaded in no-conflict mode. This means that there won’t be two jQuery scripts of different versions competing for attention. And if you prefer an external reference to jQuery (such as the one from Google Code), there is a method for doing that in a WordPress-friendly way, too (see step 2 on this linked page). [...]

]]>
By: Aaron Alexander http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/#comment-11258 Aaron Alexander Tue, 19 Jan 2010 21:19:11 +0000 http://www.ericmmartin.com/?p=832#comment-11258 @Milan How is using WP's hooks API a "hack"? The author of this post is using WP's API exactly as intended. Merely coding is not equivalent to hacking. @Milan How is using WP's hooks API a "hack"? The author of this post is using WP's API exactly as intended. Merely coding is not equivalent to hacking.

]]>
By: Mariano http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/#comment-11218 Mariano Sat, 16 Jan 2010 04:31:02 +0000 http://www.ericmmartin.com/?p=832#comment-11218 Also this is the wrap I used for my plugin to get rid of all the errors. <code> jQuery(function($){ $.fn.extend({ plugin_name: function( options ){ .... } }); }); </code> Sorry for the double post. ;) Also this is the wrap I used for my plugin to get rid of all the errors.


jQuery(function($){
$.fn.extend({
plugin_name: function( options ){
....
}
});
});

Sorry for the double post. ;)

]]>