jQuery by default is loaded in WordPress in noconflict mode. Sometimes in your child theme the jQuery library will mysteriously not load – especially in single post pages and throw errors from your own loaded scripts saying that jQuery is not defined. The best way to solve this problem is to load jQuery from your child theme.

  1. First create a function
    function my_scripts() {
    }
  2. Second dequeue jQuery
    function my_scripts() {
      wp_dequeue_script('jquery');
    }
  3. Third enqueue jquery using the hosted version at google
    function my_scripts() {
      wp_dequeue_script('jquery');
      wp_enqueue_script(
        'jquery', // name
        '//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js', // google hosted, protocol-independent
        array(), // dependencies (empty)
        NULL, // removes version
        false // load in footer, 'false' for header
      );
    }
  4. Finally add an action
    add_action('wp_enqueue_scripts', 'my_scripts');

Final product:

function my_scripts() {
  wp_dequeue_script('jquery');
  wp_enqueue_script(
    'jquery', // name
    '//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js', // google hosted, protocol-independent
    array(), // dependencies (empty)
    NULL, // removes version
    false // load in footer, 'false' for header
  );
}
add_action('wp_enqueue_scripts', 'my_scripts');

After you have typed in some text, hit ENTER to start searching...