You should use the built-in version of jQuery for compatibility reasons.
All you need to do is to enqueue it:
function theme_scripts() {
wp_enqueue_script('jquery');
}
add_action('wp_enqueue_scripts', 'theme_scripts');
Or just add it as a dependency for your script:
function theme_scripts() {
wp_enqueue_script( 'my-script', <PATH>, array('jquery'), ... );
}
add_action('wp_enqueue_scripts', 'theme_scripts');
But then… you have to remember, that jQuery is run in no-conflict mode, so in your scripts you have to access it by jQuery
and not by $
. So your script should look like so:
jQuery(function ($) {
// here you can use $ sign to get jQuery, because of the param of function
$('a').click(...); // so this will work OK
});
// but here you can't and you have to use jQuery
jQuery('a').click(...); // this will work also
$('a').click(...); // but this won't, because there is no $ accessible here