jquery and wordpress

I am looking for the right way to connect jquery to wordpress. Since this type of connection conflicts with the version of jquery that is included in WordPress:

wp_enqueue_script (‘jquery’, get_template_directory_uri (). ‘/assets/js/libs/jquery-3.3.1.min.js’);

How do I connect a jquery for my theme correctly ?

Use WP’s jQuery. Just add the “jquery” handler to your script dependencies and it will be automatically loaded.

Read this:

And this:

  • Themes must use the scripts shipped with WordPress instead of including their own copy of the script or using one from a CDN. This includes jQuery, jQuery UI, Backbone, Underscore, etc. For more information, refer to the list of scripts included with WordPress.

Thank you, but for some reason, the functionality with the built-in jquery in WordPress does not work for me.

Can I use this plugin as an alternative ?

WordPress connects version 3.5.1 which suits me but doesn’t work. (Requires 3.3.1). Plugin that updates jquery to the latest version makes the functionality work.

I think no, it will not be acceptable.

It is also a requirements that you have to use latest version jQuery. So, you have to go with jQuery v3.5.1 which comes with WordPress as default.

WP uses jQuery 3.5.1. You should make your code available for it by removing errors. You can use “Developer Tools” of your browser to see and remove all errors.