I include some custom javascript into my wordpress theme. So I added this lines to my functions.php
function add_theme_scripts() {
wp_enqueue_script('equalheight', get_template_directory_uri().'/js/equalheight.js', array ( 'jquery' ), true);
wp_enqueue_script('script', get_template_directory_uri().'/js/script.js', array ( 'jquery' ), true);
}
add_action('wp_enqueue_scripts', 'add_theme_scripts');
But the scripts having problems with jquery. I will get this in my browser console:
TypeError: $ is undefined
Why? The dependence to jquery is set.
Does anyone have an idea?