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 es 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?
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 es 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?
Solution may be found here: https://stackoverflow./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./jquery-2.2.1.min.js', null, null, true);
wp_enqueue_script('jquery221');
}
}
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.