I have looked all over the place and did not find a solution to my problem.
I have a child theme where I have a functions.php file where I try to register and enqueue the script the following way:
function wpb_adding_scripts() {
wp_register_script('my_scripts', get_stylesheet_directory_uri('js/scripts.js', __FILE__), array('jquery'),'1.1', true);
wp_enqueue_script('my_scripts');
}
add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );
And here is the script I am trying to load:
$(document).ready(function(){
alert("test");
})
I made sure I have a "js" folder in my child directory where my scripts.js is.
But for some reason, this is not working for me.
Any one got an idea?
Thank you in advance for any help.