This is my function to load the bootstrap files.
function load_js()
{
wp_register_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', 'jquery', false, true );
wp_enqueue_script('bootstrap');
}
add_action('wp_enqueue_scripts', 'load_js');
I would expect this to route to:
http://site.test/wp-content/themes/themename/js/bootstrap.min.js
But instead it does:
http://site.test/wp-content/themes/themenamejs/bootstrap.min.js
1 Answer
function load_js()
{
wp_register_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), false, true );
wp_enqueue_script('bootstrap');
}
add_action('wp_enqueue_scripts', 'load_js');
Use with array('jquery')
instead of 'jquery'
Refference here.
It says: use array.