Reputation: 83
I would like to add a jQuery library to my Wordpress site. I watched a lot of tutorials but all of them explain how to add a single js file only. But my library has multiple js files, css, etc. How can I add the whole library? Thank you very much!
Upvotes: 0
Views: 88
Reputation: 133
Wordpress alredy includes a copy of Jquery library. In your theme functions.php file you just simply have to load it like this
add_action( 'wp_enqueue_scripts', 'theme_enqueue_scripts' );
function theme_enqueue_scripts() {
wp_enqueue_script("jquery");
wp_enqueue_script( 'map-script', get_template_directory_uri() . '/js/map-script.js', array('jquery'), '20151215', true );
}
Upvotes: 1