I am working with a wordpress site and I am trying to insert some custom code for a CSS navigation menu. The CSS code calls for a tag with this information in it:
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script>
Whenever I insert this code into the head tag, the navigation consequently fails on any mobile browser. Can someone explain?
Thank you!
WordPress handles the loading of jQuery. If you insert that tag into the head you will duplicate it which is causing the problem.
To ensure jQuery is being loaded on every page go into your theme's functions.php file and add the following:
function my_enqueue_jquery() {
wp_enqueue_script( 'jquery' );
}
add_action( 'wp_enqueue_scripts', 'my_enqueue_jquery' );