I know that wordpress ships with jquery. I have built my site first in html and every script that I have running in the html version works fine running version 1.4.2. I included this same jquery script and now one of my features don't work. This is how I am loading jquery into the head of my site
function register_savior_scripts(){
wp_deregister_script('jquery');
wp_enqueue_script('prettyPhoto', get_template_directory_uri().'/js/jquery.prettyPhoto.js', array('jquery'));
wp_enqueue_script('js-scripts',get_template_directory_uri().'/js/jquery.js');
wp_enqueue_script('slider', get_template_directory_uri().'/js/coin-slider.min.js', array('jquery'));
}
add_action('wp_head','register_savior_scripts', 0);
If I check the head, I see the script. It looks like this
<script type='text/javascript' src='full path removed/js/jquery.js?ver=3.4.1'></script>
It's not version 3.4.1. Not sure that matters. The script that it is running I put directly into the head and is this code
<script>
$(document).ready(function(){
$(".controls").click(function(e){
if($(this).hasClass('down-arrow')) {
$(this).addClass('up-arrow').removeClass('down-arrow');
}
else {
$(this).addClass('down-arrow').removeClass('up-arrow');
}
e.preventDefault();
$("#logo-background").slideToggle("slow");
});
});
Is there a better way to load the script above into the head? Do you know why it would work on the html but not wordpress?
All it does is slide a div up or down to hide it if you press a link.