I'm having trouble adding a custom JavaScript file to my child WordPress theme. I'm use the Spacious WordPress theme, and created a Child theme based on it. I have successfully added a custom stylesheet, but so far been unsuccessful in adding a custom JavaScript file. I have followed the instructions provided in the WordPress Developers Handbook on Including CSS & JavaScript.
In my child theme functions.php
...
function spacious_child_enqueue_scripts(){
wp_register_script('custom_js',get_template_directory_uri().'/js/custom_js.js', array('jquery'), '', true);
wp_enqueue_script('custom_js');
}
add_action('wp_enqueue_scripts', 'spacious_child_enqueue_styles','spacious_child_enqueue_scripts','get_the_excerpt', 'new_excerpt_more');
...
What am I doing wrong? I can provide additional files and code if needed. Thanks in advance.