Did you know that WordPress comes with the latest version of jQuery at the time of its release? While you can include jQuery into your template file manually, you may run into version conflicts and other broken features. Keep it simple and use WordPress’ own ‘wp_enqueue_script()” function. By using this function you tell WordPress to load its version of jQuery, if its not already loading. Plugin and theme developers alike should (and mostly do) be using this function in their projects to avoid loading multiple versions of the same file and also to avoid potential versioning conflicts.

How To:

To use this function to load jQuery, place this snippet of code in your template header file, before the wp_head() function. It’s that easy! Now as you update WordPress, your theme will then load the latest version of jQuery.

<br />wp_enqueue_script('jquery');<br />

Leave a Reply