Child theme is not rendering parent and own javascripts (but css loaded properly, js not)

The function get_template_directory_uri always returns the directory of the PARENT THEME, even if in a child theme, while the function get_stylesheet_directory_uri() returns the directory of your child theme.

I guess that your scripts are enqueued in the parent theme using the “get_stylesheet_directory_uri” method, meaning the javascript won’t be found in the child theme.

I would suggest changing ALL the enqueues in the parent AND the child (but not the main style css) to using get_theme_file_uri(file) like this:

function custom_enqueue_scripts() {
    wp_enqueue_script( 'consultox-main-script', get_theme_file_uri('/js/custom_script.js'), array(), false, true );
}
add_action( 'wp_enqueue_scripts', 'custom_enqueue_scripts' );

get_theme_file_uri works by looking into the current theme for the searched file, and if it doesn’t find it, looks for the file in the parent theme (if there is one). This way, the correct styles and scripts are loaded in your parent AND your child theme 😉

Happy Coding!