admin管理员组文章数量:1026639
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?
Share Improve this question asked Jul 2, 2019 at 7:24 user11727797user11727797 5- 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 Commented Jul 2, 2019 at 7:54
- possible duplication: stackoverflow./questions/37797407/… – Alex Stulov Commented Jul 2, 2019 at 8:51
- its not duplication @AlexStulov – user11727797 Commented Jul 2, 2019 at 8:54
- yes i use ocean wp theme @F3L1X79 – user11727797 Commented Jul 2, 2019 at 8: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 Commented Jul 2, 2019 at 9:10
2 Answers
Reset to default 1Solution 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.
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?
Share Improve this question asked Jul 2, 2019 at 7:24 user11727797user11727797 5- 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 Commented Jul 2, 2019 at 7:54
- possible duplication: stackoverflow./questions/37797407/… – Alex Stulov Commented Jul 2, 2019 at 8:51
- its not duplication @AlexStulov – user11727797 Commented Jul 2, 2019 at 8:54
- yes i use ocean wp theme @F3L1X79 – user11727797 Commented Jul 2, 2019 at 8: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 Commented Jul 2, 2019 at 9:10
2 Answers
Reset to default 1Solution 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.
本文标签: javascriptFind the double jqueryjs include and remove itStack Overflow
版权声明:本文标题:javascript - Find the double jquery.js include and remove it - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745648421a2161165.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论