How to include jQuery in a WordPress theme?

admin

Administrator
Staff member
I am pretty new to WordPress and I am figuring out how to include jQuery into a theme.

I create the following function into <strong>functions.php</strong> theme:

Code:
function load_java_scripts() {
    // Load FlexSlider JavaScript that handle the SlideShow:
    wp_enqueue_script('jQuery-js', 'http://code.jquery.com/jquery.js', array(), '1.0', true);
}
add_action('wp_enqueue_scripts', 'load_java_scripts');

So I think that I can add it as some other JavaScript or CSS local resources but I am not sure about this method because in this case the <strong>jquery.js</strong> is not a local resource but is an online resource (is it the same thing?)

I also have some doubts because searching online I have found different methods to add jQuery to my theme, like this <a href="http://css-tricks.com/snippets/wordpress/include-jquery-in-wordpress-theme/" rel="nofollow">one</a>.

Can you give me some information about how to correctly complete this task?