function loadbootstrap() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', '
https://code.jquery.com/jquery-3.2.1.slim.min.js');
wp_enqueue_script( 'jquery' );
// Bootstrap stylesheet.
wp_enqueue_style( 'bootstrap-style', get_template_directory_uri() .
'/css/bootstrap.min.css', array(), ' ' );
//Mytheme stylesheet.
wp_enqueue_style( 'mytheme-style', get_template_directory_uri() .
'/css/style.css', array(), ' ' );
//Bootstrap js
wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() .
'/js/bootstrap.min.js', array('jquery'), ' ' );
//particles + app
wp_enqueue_script('particles-js', get_template_directory_uri() .
'/js/particles.js', array('jquery'), ' ' );
wp_enqueue_script('app-js', get_template_directory_uri() .
'/js/app.js', array('jquery'), ' ' );
}
add_action('wp_enqueue_scripts', 'loadbootstrap');
Ошибка в консоли
Uncaught Error: Bootstrap dropdown require Popper.js (
https://popper.js.org)
at bootstrap.min.js?ver= :6
at bootstrap.min.js?ver= :6
at bootstrap.min.js?ver= :6
(anonymous) @ bootstrap.min.js?ver= :6
(anonymous) @ bootstrap.min.js?ver= :6
(anonymous) @ bootstrap.min.js?ver= :6
particles.js?ver= :1495 Uncaught TypeError: Cannot read property 'getElementsByClassName' of null
at window.particlesJS (particles.js?ver= :1495)
at app.js?ver= :14
window.particlesJS @ particles.js?ver= :1495
(anonymous) @ app.js?ver= :14
(index):67 GET
test.ru/particles.js