简体   繁体   English

wp-admin 上缺少 jquery - wordpress

[英]jquery missing on wp-admin - wordpress

I have problem with missing files of jquery in wp-admin.我在 wp-admin 中缺少 jquery 文件的问题。 On live site everything is correct, 0 bugs but on wp-admin like you see it's messing jquery file.在实时站点上,一切都是正确的,0 个错误,但在 wp-admin 上,就像您看到的那样,它正在弄乱 jquery 文件。 Any ideas?有任何想法吗?

在此处输入图像描述

Maybe there is a plugin which causes the problem.也许有一个插件会导致问题。 Try to deactivate them one by one, if it solves the issue.如果可以解决问题,请尝试将它们一一停用。 Try changing the theme, there might be the problem.换个主题试试,可能有问题。 If this does not help:如果这没有帮助:

You can try to add jQuery to your backend by hand using admin_enqueue_scripts and putting this in the function.php file of your theme:您可以尝试使用admin_enqueue_scripts手动将 jQuery 添加到后端,并将其放入主题的 function.php 文件中:

function my_jquery_script() {

    wp_enqueue_script( 'jQuery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js');

}    
add_action( 'admin_enqueue_scripts', 'my_jquery_script' );

https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/ https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM