One of the most common problems that plagues professional theme, plugin, and application developers in WordPress is when libraries such as jQuery are improperly dequeued, deregistered, or simply moved to load else where in the page.
Not only can this drastically impact the site on which the code is running, it can adversely affect the performance of every other well-coded plugin or theme that a user may eventually use.
So in my latest article on WPTuts+, I attempt to provide a beginner’s to for how to enqueue jQuery in WordPress.
Enqueue jQuery in WordPress Properly
In short, the article attempts to provide the rationale and reasoning along with practical steps for how to properly enqueue jQuery in WordPress as well as the reasons why it’s problematic to do it any other way.
Specifically, the article covers the following topics:
- Thinking of WordPress as a Foundation
- How To Properly Include jQuery
Ultimately, the purpose of the article to continue evangelizing best practices to prevent plugins from breaking other plugins, themes, and things built on top of WordPress.
For those who are interested, Edward Cassie, Eric Mann, and myself have actually been talking a little bit about jQuery and how to properly scope it on Twitter at the time that this post was written.
We’ve a long way to go, but hopefully we can keep spreading the good word.