Enqueue Jquery

This is how to enqueue jquery and several other scripts that depend on jQuery. Paste the following into your functions.php file: /** * Add jQuery */ function add_jquery_script() { wp_deregister_script( ‘jquery’ ); wp_register_script( ‘jquery’, ‘https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js’); wp_enqueue_script( ‘jquery’ ); } add_action(‘wp_enqueue_scripts’, ‘add_jquery_script’); function my_scripts_method() { wp_enqueue_script( ‘custom-script’, get_template_directory_uri() . ‘/js/theme.script.js’, array( ‘jquery’ ) ); wp_enqueue_script( ‘jquery-easing’, Read More…

Jquery no conflict $ instead of Jquery

If you really like the short $ instead of jQuery, you can use the following wrapper around your code: jQuery(document).ready(function($) { // Inside of this function, $() will work as an alias for jQuery() // and other libraries also using $ will not be accessible under this shortcut });

Document.ready vs window.load

I implemented a custom slider plugin called flexslider2 by woothemes and It worked in chrome and safari, but not firefox and IE. I figured out that if I moved my javascript/jQuery code that is used to call call the slider from jQuery(document).ready(function() { } to $(window).load(function() { } it fixed the problem