I have a WordPress theme that includes jQuery, but for some reason the "$" doesn't let me call jQuery. I know I can wrap jQuery calls in an anonymous function, but I have other plugins that rely on the $ working, and I don't want to modify their code.
So I need a way to make "$" work for jQuery, globally, across all JS in my site.
My theme adds jQuery with this (in functions.php):
function ss_scripts() {
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-core');
wp_enqueue_style( 'ss-style', get_stylesheet_uri() );
}
add_action( 'wp_enqueue_scripts', 'ss_scripts' );
So two questions:
- Why doesn't jQuery default to the "$" when the script is added this way?
- How can I make the $ use jQuery, globally, across my entire site?