Hey,
I am trying to add some js code to my website. I think the child theme is a good option, but it does not work.^^
I tried this code in function.php of the child theme:
function ah_custom_js_file() {
// Enqueue a custom JS file with jQuery as a dependency
wp_enqueue_script(‘custom-js’, get_stylesheet_directory_uri() . ‘js/custom.js’, array(‘jquery’), false, false);
}
add_action(‘wp_enqueue_scripts’, ‘ah_custom_js_file’);
…
So i created a folder in the child theme for js and write my code into it.
Unfortunately it does not work. At least an alert was initially recognized. But not anymore either.
Maybe you can help or have a look?
Would be nice,
Regards