I've been trying to add my custom jQuery script to wordpress, the script code and all is working on jsfiddle when I choose the jquery library, but when I'm trying to add it on wordpress it is not working. Here's how added the wp enqueue code:
function cb_scroller() {
//wp_enqueue_script('jquery');
wp_register_script( 'scroller', get_template_directory_uri() . '/js/scroller.js', array('jquery'),'',true );
wp_enqueue_script( 'scroller' );
}
add_action( 'wp_enqueue_scripts', 'cb_scroller' );
So what may be the problem? here's the jsfiddle attempt: https://jsfiddle.net/naimelhajj/q4bdfcwb/ (disregard the styling, I've imported the css and js as "external resources")