WordPress is designed to interact smoothly with jQuery, and new jQuery versions are often included in WordPress updates. The proper way to call jQuery in WordPress is designed with these updates in mind, and ensures that a consistent version of jQuery gets used.
For a refresher on jQuery and WordPress, check out this digwp post on how to include jQuery the right way. It demonstrates how to make sure you don’t have conflicting jQuery libraries in your site, as well as the proper way to call jQuery in your WordPress.
Recently, we resolved a client’s WordPress where the jQuery was installed into the header AND the footer. The footer jQuery was a previous version hardcoded into a plugin. This meant that two different versions of jQuery ended up being called, and the site was producing slightly broken HTML. The client filed a support ticket for us to see if we couldn’t figure out the problem.
This sort of issue can be challenging to diagnose because the problem may not point you to a jQuery code error. Can you say, “aggravating?”
Below are screenshots of how the errors were presenting.
We’ll go into how to solve this problem in a post next week.