How to add a custom.js file for a child-theme in a swift way?
By "swift" I mean to a way that won't involve changing anything in the parent theme and will be minimal by means of coping and modifying any settings file from the parent theme to the child theme.
Adding the following code to the
add_action function right after
wp_enqueue_style function call in functions.php, causes the site to crash (I'm not a PHP programmer and as for now, don't know how to debug this):
wp_enqueue_script( string $handle, string $src = '/custom.js', array $deps = array(), string|bool|null $ver = false, bool $in_footer = false );
This also doesn't bring any effect (even though the site doesn't crash):
wp_enqueue_script( 'custom', get_stylesheet_directory_uri() . '/custom.js');