I tried everything and my action hook wp_enqueue_scripts doesn’t work! What can stop it from working? This is my code inside the plugin. The plugin is activated:
function wpb_adding_scripts() {
error_log("try 9");
}
add_action ('wp_enqueue_scripts', 'wpb_adding_scripts');
2 Answers
The wp_enqueue_scripts
function is hooked to run on the wp_head
action, which is triggered by the wp_head()
function.
This function should be placed within the <head>
tag of your theme’s markup.
If we refer to the core file default-filters.php
, we can see the many functions that rely on wp_head
for output.