This is one of those articles you tuck away in Evernote or your favorite “read it later” app because it will most likely not mean anything to you right this moment, but when it does happen, you will be glad you saved this.
I got everything setup and I was settling in for a good, long second shift when I saw this in my WordPress admin.
All the WordPress admin styles were not loading.
This was not what I had planned for my evening… *sigh*
I wasn’t sure what was going on… Could it be something wonky with my new computer? Was it due to updating to the shiny new WordPress 3.5? I tried to reinstall WordPress a couple of times to no avail, so intense Google searching ensued.
I cannot remember how many articles I read or how many suggested hacks I attempted. I do know it took well over an hour and none of them worked. Then I found something buried deep in some sketchy looking site, but it worked!
I am not trying to hold out on giving credit to the person who suggested it. I simply did not think to save the URL at the time. But this is what the article suggested.
And let me be clear… I do not encourage WordPress core hacks, but in the moment, I just wanted to fix it and move on with my small window of time I had to work on my hotfix.
wp-admin/load-styles.php file, find this line of code…
…and change it to this…
…and then simply refresh your WordPress admin screen a few times. You should see the WordPress admin CSS styles come back to normal.
That’s it! And you do not even have to leave this WordPress core modification in place. Once the admin styles come back, you can revert the line of code back to what it was and you should still have smooth sailing after that.
Dan in the comments also said that simply adding the code below to your
wp-config.php file will also do the same trick. It certainly feels better than modifying the WordPress core, even if it is just temporarily.
So if you ever run across this, perhaps it can save you some time and get you back on track. I am not saying this will work in all cases of the WordPress admin not loading the styles, but this is what worked for me.
I have no idea why this works, so if you have a more technical or detailed explanation of why, then I would love to hear so in the comments.
I have never had this happen again, otherwise, I will dig in much deeper next time to see if I can identify a root cause.