how to fetch jQuery in wordpress
Open your theme's functions.php file.
Enqueue jQuery by adding the following code:
function enqueue_jquery() {
wp_enqueue_script('jquery');
}
add_action('wp_enqueue_scripts', 'enqueue_jquery');
Save the changes to your functions.php file.
Ensure that your theme's header.php file contains the wp_head() function just before the closing tag:
<?php wp_head(); ?>
</head>
Save the changes to your header.php file.
Check your WordPress site's front end to verify that jQuery is now being loaded.