1

I want to add j Query file in my WordPress site footer and i already did it. but problem is whenever i add j Query file in my WordPress site footer so slider revolution show me error like that.

Revolution Slider Error: You have some jquery.js library include that comes after the revolution files js include. This includes make eliminates the revolution slider libraries, and make it not work.

Find the double jquery.js include and remove it.

When i remove j Query then slider revolution working good. But i want to add j Query 2.2.1 for my work but i can't. how i fix it?

  • Are you using a specifing theme? The injection of jQuery is usually located in the _functions.php_ file of your theme - using the function *add_action('wp_enqueue_scripts', 'XXX_scripts');* – F3L1X79 Jul 02 '19 at 07:54
  • possible duplication: https://stackoverflow.com/questions/37797407/wordpress-plugin-slider-revolution-error – Alex Stulov Jul 02 '19 at 08:51
  • its not duplication @AlexStulov –  Jul 02 '19 at 08:54
  • yes i use ocean wp theme @F3L1X79 –  Jul 02 '19 at 08:55
  • You can place you jquery above slider's jquery, but it will be most probably overwritten. You can replace slider's version of jquery with the desired one, but that might lead to another pack of problems. – Alex Stulov Jul 02 '19 at 09:10

2 Answers2

1

If you are using any caching plugin like wp fastest cache, autoptimize etc. then please remove it and check if it is working or not because this error is raised due to some jquery conflict. if it is working after disabling plugin it means there is problem in caching plugin.

Brijesh Dhanani
  • 856
  • 4
  • 12
1

Solution may be found here: https://stackoverflow.com/a/23551006/3933603 , from @deweydb.

Add these lines inside your theme folder's function.php file:

//remove the default jQuery script
add_filter( 'wp_default_scripts', 'change_default_jquery' );

function change_default_jquery( &$scripts){
    if(!is_admin()){
        $scripts->remove('jquery');
    }
}

//inject a new one from a remote source
add_action('wp_enqueue_scripts', 'ocean_theme_scripts');

function ocean_theme_scripts() {
    if(!is_admin()){
        wp_register_script('jquery221', '//code.jquery.com/jquery-2.2.1.min.js', null, null, true);
        wp_enqueue_script('jquery221');
    }
}
F3L1X79
  • 2,575
  • 2
  • 29
  • 45