I was trying to load a parallax
jQuery
file but eventhough it's loaded in the index file, it doesn't trigger anything... Not even a simple alert('test')
functions.php
function theme_scripts() {
wp_enqueue_style( 'theme-style', get_stylesheet_uri() );
wp_enqueue_style( 'theme-jquery', "https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" );
wp_enqueue_style( 'theme-parallax', get_template_directory_uri() . "/scripts/parallax.js");
wp_enqueue_style( 'theme-mainjs', get_template_directory_uri() . "/scripts/main.js" );
}
add_action( 'wp_enqueue_scripts', 'theme_scripts' );
Example main.js
(function($) {
$(function() {
alert('test')
});
})(jQuery);
Lookin at console, there are no errors. Everything is loaded just fine.