wp_enqueue_scripts
is a PHP hook, so you should use it in PHP. It won’t work, if you add it to some JS file.
So if it’s not a typo and you really put this code to functions.js
file, then that’s the reason it doesn’t work.
wp_enqueue_scripts
is a PHP hook, so you should use it in PHP. It won’t work, if you add it to some JS file.
So if it’s not a typo and you really put this code to functions.js
file, then that’s the reason it doesn’t work.