This topic has 2 replies, 2 voices, and was last updated 5 years ago ago by Rose Tyler
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
Hello,
We’ve changed code in functions.php of your child theme. Please check.
Regards
You must be logged in to reply to this topic.Log in/Sign up