Darshit Soni Darshit Soni - 3 years ago 176
Javascript Question

wordpress jquery version conflicts

In Wordpress use hook wp_enqueue_script to override jQuery version but it does not work.And i need both jquery.

I want to add new jquery version for website customization.

But when i add new version of jquery the old version of jquery functionally not working

function.php:

function themeslug_enqueue_script(){
wp_enqueue_script('child_theme_script_handle', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js',
array( 'jquery' ), '3.2.1', true );
wp_enqueue_script( 'my-great-script', get_stylesheet_directory_uri() . '/core/assets/js/multi-vendors.js',
array( 'jquery' ), '1.0', true );
}

add_action('wp_enqueue_scripts', 'themeslug_enqueue_script');


jQuery.js:

$(document).ready(function(){
alert('Hello');
});


Some functionally is not working. For example, the slider.

Answer Source

Thanks Every one to give suggestion.

I put my code in custom.js file and It's work. There is no need to add new jquery.

Sorry to misguide you.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download