That’s because the jQuery that comes with WP is in compatibility mode where $ won’t work so it doesn’t conflict with any other libraries using the same sign as well. You can change all instances of $ to jQuery and that should work. You can check the link below for more info. https://digwp.com/2011/09/using-instead-of-jquery-in-wordpress/