Wordpress 管理员未加载 css/js
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18769141/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Wordpress admin not loading css/js
提问by Marlon Creative
I'm having a problem with the admin on a Wordpress site. I've scoured the interwebs and seen lots of other people with the same problem, but no definite solution. The admin is showing like this:
我在 Wordpress 网站上遇到管理员问题。我浏览了互联网,看到很多其他人也有同样的问题,但没有明确的解决方案。管理员显示如下:
And when I inspect it, I get a 500 (Internal Server Error)on both load-styles.phpand load-scripts.php
当我检查它时,我在load-styles.php和load-scripts.php上得到500(内部服务器错误)
Anyone know what's up, and how to rectify?
有谁知道这是怎么回事,如何纠正?
回答by Arun Raj
In wp-config.php
before require_once
add below code into file :
在wp-config.php
之前require_once
添加以下代码到文件中:
define('CONCATENATE_SCRIPTS', false);
回答by TonyG
Just to keep everything in one answer, this worked for me:
只是为了将所有内容都放在一个答案中,这对我有用:
define('FORCE_SSL_LOGIN', true);
define('FORCE_SSL_ADMIN', true);
define( 'CONCATENATE_SCRIPTS', false );
define( 'SCRIPT_DEBUG', true );
After page refreshing and it looks OK, maybe after re-login, set SCRIPT_DEBUG to false.
页面刷新后看起来正常,可能是重新登录后,将SCRIPT_DEBUG设置为false。
Don't forget about those last two settings if you're using a plugins for debugging or site optimization - though such plugins might override those settings.
如果您使用插件进行调试或站点优化,请不要忘记最后两个设置 - 尽管此类插件可能会覆盖这些设置。
回答by Баръш Юмеров
In wp-config.php file you can add - define( 'SCRIPT_DEBUG', true); This solves the problem but, it is not good practice to leave this config on true while on production.
在 wp-config.php 文件中,您可以添加 -define('SCRIPT_DEBUG', true); 这解决了问题,但是,在生产时将此配置保留为 true 并不是一个好习惯。
Hope it helps
希望能帮助到你
回答by Mauricio Arcehelizaga
I was having a similar issue with a new installation of Wordpress that needed redirecting to a temporary url.
我在新安装的 Wordpress 中遇到了类似的问题,需要重定向到临时 url。
My solution was to make sure the siteurl and home url had the http:// at the beginning of the url.
我的解决方案是确保 siteurl 和 home url 在 url 的开头有 http:// 。
Hope it fixes it.
希望它修复它。
回答by Matoeil
the CSS was not loaded in my case ( with WordPress 3.7.1) because of an encoding problem.
由于编码问题,在我的情况下(使用 WordPress 3.7.1)没有加载 CSS。
Force UTF-8 encoding by replacing in wp-admin/load-styles.php
the corresponding line by :
通过在wp-admin/load-styles.php
相应的行中替换为强制 UTF-8 编码:
header('Content-Type: text/css; charset=UTF-8');
回答by Umair Hamid
Put define('SCRIPT_DEBUG', true);
in wp-config.php and debug through console. It will tell you which file is not found during page load.
放入define('SCRIPT_DEBUG', true);
wp-config.php 并通过控制台调试。它会告诉您在页面加载期间未找到哪个文件。