Answer the question
In order to leave comments, you need to log in
Custom scripts in WP child theme?
I include a regular JS file in the child theme, my functions.php file looks like this:
<?php
function theme_js() {
wp_enqueue_script( 'theme_js', get_template_directory_uri() . '/js/custom.js', array( 'jquery' ), '1.0', true );
}
add_action('wp_enqueue_scripts', 'theme_js');
?>
wp_enqueue_script( 'theme_js', get_template_directory_uri() . '/js/custom/custom.js', array( 'jquery' ), '1.0', true );
Answer the question
In order to leave comments, you need to log in
Perhaps you need to connect the script file of the parent theme at the beginning, and then add your own to array, depending on the parent file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question