how to fetch jQuery in wordpress

  1. Open your theme's functions.php file.

  2. Enqueue jQuery by adding the following code:

function enqueue_jquery() {
    wp_enqueue_script('jquery');
}

add_action('wp_enqueue_scripts', 'enqueue_jquery');
  1. Save the changes to your functions.php file.

  2. Ensure that your theme's header.php file contains the wp_head() function just before the closing tag:

<?php wp_head(); ?>
</head>
  1. Save the changes to your header.php file.

  2. Check your WordPress site's front end to verify that jQuery is now being loaded.