How to correctly handle including jQuery from a theme..??
-
I’m using a theme that I downloaded and I ran into some issues with some of the plugins that I was using not working correctly. After studying some I found that my theme is including jQuery 1.4.2 from Google API’s but it’s just statically including it. The plugins are then adding 1.4.4 and it was causing me issues.
If I simply comment out the line that’s adding 1.4.2 in my theme’s footer.php file then everything is fine, but I’d like to figure out the correct way to handle this.
I attempted the following from within the theme based on information I got here: https://codex.www.ads-software.com/Function_Reference/wp_enqueue_script
if(!is_admin()) { wp_register_script('jquery','https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.ms'); wp_enqueue_script('jquery'); }
I disabled all my plugins thinking the theme’s jQuery stuff would still be ok, but it’s not. The theme’s jQuery functions do indeed work with 1.4.4 so I know that’s ok.
Any information on how to correctly handle this from within my theme would be greatly appreciated. Thanks!
- The topic ‘How to correctly handle including jQuery from a theme..??’ is closed to new replies.