K
K
kaz1ngton2021-09-15 23:20:44
WordPress
kaz1ngton, 2021-09-15 23:20:44

wp_enqueue_scripts hook not working?

Connected scripts and styles in VP. There were no results, after which I found the root of the problem - it was the "wp_enqueue_scripts" hook that did not work. I thought that the VP flew - reinstalled, the problem was not solved. Maybe I'm missing something important and it should not be activated under unspecified conditions? Here is a piece of code:

function agro_invest_scripts() {
  wp_enqueue_style('main', get_template_directory_uri() . '/build/css/main.min.css');
  wp_enqueue_style('theme', get_stylesheet_uri());
  
  wp_enqueue_script('scripts', get_template_directory_uri() . '/build/js/main.min.js', [], _S_VERSION, true);
}

add_action('wp_enqueue_scripts', 'agro_invest_scripts');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Zolin, 2021-09-16
@kaz1ngton

I copied your code to my clean theme, all scripts are connected
61429684750c2846847384.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question