Why not my loading js script in WordPress

I am trying to add bootstrap js script to my WordPress theme as "correct", but I do not see the link to the js file in the header section of the web page at startup. I tried adding it to the WordPress theme title as “correct,” but no luck. Now I am trying in a file functions.phpand still no luck.

function buns_bootstrap_run(){
    wp_register_script('bootstrap-js', get_stylesheet_directory() . '/js/bootstrap.min.js', array('jquery'),'3.2.0', false);
    wp_enqueue_script('bootstrap-js');
}

add_action('wp_enqueue_script', 'buns_bootstrap_run');
+4
source share
1 answer

Action is not called wp_enqueue_scriptbutwp_enqueue_scripts

add_action('wp_enqueue_scripts', 'buns_bootstrap_run');

There is a difference between the action that is called when the scripts should be queued and the function that actually queues them

+2
source

All Articles