In addition to one other script, I am tying to enqueue the waypoints script in my functions.php file for Wordpress.
I can't work out why the first script works but the second (waypoints) script will not load?
I am not sure what the true and false relate to and if this is the cause.
I have tried a few variations from different websites, including the following:
function my_custom_scripts() {
wp_enqueue_script( 'custom-js', get_stylesheet_directory_uri() . '/js/custom.js', false );
}
add_action( 'wp_enqueue_scripts', 'my_custom_scripts' );
function enqueue_waypoints() {
wp_enqueue_script( 'waypoints', get_stylesheet_directory_uri() . '/js/jquery.waypoints.min.js', array('jquery'), true);
}
add_action( 'wp_enqueue_scripts', 'enqueue_waypoints' );
I also tried:
function my_custom_scripts() {
wp_enqueue_script( 'custom-js', get_stylesheet_directory_uri() . '/js/custom.js', array( 'jquery' ),'',true );
wp_enqueue_script( 'waypoints', get_stylesheet_directory_uri() . '/js/jquery.waypoints.min.js', array('jquery'), true);}
add_action( 'wp_enqueue_scripts', 'my_custom_scripts' );
There are no console errors.
What am I doing wrong?
Thanks.
Edit ** - I have just realised that while the first script loads, the addition of the second script breaks the js code in the first script.