Wordpress admin not loading css/js

2020-03-01 05:21发布

问题:

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:

And when I inspect it, I get a 500 (Internal Server Error) on both load-styles.php and load-scripts.php

Anyone know what's up, and how to rectify?

回答1:

In wp-config.php before require_once add below code into file :

define('CONCATENATE_SCRIPTS', false); 


回答2:

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.

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.



回答3:

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.



回答4:

the CSS was not loaded in my case ( with WordPress 3.7.1) because of an encoding problem.

Force UTF-8 encoding by replacing in wp-admin/load-styles.php the corresponding line by :

header('Content-Type: text/css; charset=UTF-8');


回答5:

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.

Hope it helps



回答6:

I was having a similar issue with a new installation of Wordpress that needed redirecting to a temporary url.

My solution was to make sure the siteurl and home url had the http:// at the beginning of the url.

Hope it fixes it.



标签: wordpress