I am using WP's local jQuery. All my own scripts are working fine! But bootstrap gives me this error message in the console: Uncaught Error: Bootstrap's JavaScript requires jQuery
.
How can I make bootstrap using WP's local jQuery?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI am using WP's local jQuery. All my own scripts are working fine! But bootstrap gives me this error message in the console: Uncaught Error: Bootstrap's JavaScript requires jQuery
.
How can I make bootstrap using WP's local jQuery?
Ideally, using WP methods to enqueue bootstrap JS dependencies you can just set jQuery as a requirement and WordPress will take care of the rest.
<?php wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/bootstrap/js/bootstrap.js', array( 'jquery' ) ); ?>