Enqueue JQuery in Wordpress when required for custom scripts in the header/footer.
Remember to use "jQuery" instead of "$" for functions in WP!
<?php wp_enqueue_script('jquery'); ?> <script> jQuery(function() { //code goes here </script>