WordPress.org

Ready to get started?Download WordPress

Forums

Dashboard CSS not loading in Firefox (20 posts)

  1. jonathansulo
    Member
    Posted 4 years ago #

    I'm experiencing the same problem as many others, with the css not loading in the Dashboard (when using Firefox). This occurs in brand new installations of both WP and WPMU (without any plugins/other modifications).

    I think I might have found a solution (though I don't know how to implement it).

    Here's the css that doesn't load (from the source code of wp-admin.php):

    <link rel='stylesheet' href='http://(INSERT DOMAIN HERE)/wp-admin/load-styles.php?c=0&dir=ltr&load=dashboard,plugin-install,global,wp-admin&ver=6403d4cb3e6353f406fd43f1b0373ec2' type='text/css' media='all' />

    But the following css does load:

    <link rel='stylesheet' href='http://(INSERT DOMAIN HERE)/wp-admin/load-styles.php?c=0&dir=ltr&load=dashboard,plugin-install,global,wp-admin&ver=6403d4cb3e6353f406fd43f1b0373ec2' type='text/css' media='all' />

    As you can see, the "&" signs are encoded. How do I un-encode them?

    Update: It seems that the code doesn't show up correctly above. In the first css call, the &-signs are encoded to & amp; (remove space after &).

  2. Thord Daniel Hedengren
    Member
    Posted 4 years ago #

    I got this on Twitter, but I'm not sure what it means. Anyone?

    I would think that it's supposed to have the entities there. It's most likely esc_url() (no idea if that's the name).

  3. Ryan McCue
    Member
    Posted 4 years ago #

    It means, I think the URL is being escaped by the HTML entities parser. Whether it should or not, I don't know. :)

  4. Peter A. Gebhardt
    Member
    Posted 4 years ago #

    Put a line on top of your .htaccess file (or create one if not already there):

    AddType text/css .css

    and put the file here:

    ../yourdomain/wp_yours/.htaccess

    NOT in ../yourdomain or even higher!

  5. jonathansulo
    Member
    Posted 4 years ago #

    Thank you all for your answers.

    I'm using nginx (doesn't work with .htaccess files), but I've included text/css as a mime type in the web server config. I suspected earlier that it could be a server related mime type error, so I've double-checked the setup. It includes text/css correctly.

    I'm more on the lines of what tdh and rmccue are saying, that this is a weird rewrite that WP (or the server) somehow does.

  6. jonathansulo
    Member
    Posted 4 years ago #

    I just tested the mime type theory with a WP.com blog and the encoded url. It didn't work. But when I tested the url, without the encoding, it did work. I'm pretty sure they've got the mime type setup correct.

  7. llizard
    Member
    Posted 4 years ago #

    One of my wordpresses is hosted on a free server that adds an ad link bar to any file with the extension of .html or .php.

    .htaccess has very limited permissions so there is no hope that an alteration of the .htaccess file will do anything at all. (any .htaccess files are pretty much ignored)

    The attached ad coding, of course, causes the server to misinterpret the php file, sending it as text/html instead of text/css (even though it says in the coding that it is text/css).

    Firefox error message:

    Error: The stylesheet /wordpress/wp-admin/load-styles.php?c=0&dir=ltr&load=global,wp-admin&ver=ba4d987ec2b562bd22e5da70fe38318d was not loaded because its MIME type, "text/html", is not "text/css".
    Source File: /wordpress/wp-admin/post.php?action=edit&post=110
    Line: 0

    The admin area did show up correctly in wp 2.7. Unfortunately, I have no idea what was different about the coding that allowed this to happen.

    While it's all very well to be able to move things around, it would be nice if there were a static css that would display things correctly.

    Amazingly, (or not, depending on your point of view) the admin panel is rendered correctly in IE. Too bad I rarely use IE....

  8. Thord Daniel Hedengren
    Member
    Posted 4 years ago #

    Thanks lizard, let's see what the tech people make of that!

  9. Probably need some form of access to the WordPress install to diagnose this.

    Would be willing to help.

  10. Thord Daniel Hedengren
    Member
    Posted 4 years ago #

    Thanks Westi, hooking up with you on Twitter.

  11. Thord Daniel Hedengren
    Member
    Posted 4 years ago #

    This issue is solved - Westi will blog it so that others won't have to bang their heads in the wall over this. Will link the blog post from here when it is up, obviously.

    Thanks all!

  12. Turns out this was an issue with the php configuration and how the default_charset was configured with some smart quotes interfering.

    For more detail please read my blog post here: http://blog.ftwr.co.uk/archives/2009/09/29/missing-dashboard-css-and-the-perils-of-smart-quotes/

  13. Thord Daniel Hedengren
    Member
    Posted 4 years ago #

    Most likely the same problem is to blame for other people running into the CSS issue in Firefox. Anyone who stumbles across that sort of question should point to Westi's excellent blog post.

  14. UUCamper
    Member
    Posted 4 years ago #

    I checked the blog post. While my Dashboard looks exactly like the example (no CSS), the problem doesn't seem to be with the charset but with the: content="text/html;......." rather than incorrect quote marks.

    Here's the source from the Firefox error console:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Profile ‹ XXXXXXXX — WordPress</title>
    <script type="text/javascript">
    //<![CDATA[
    addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
    var userSettings = {'url':'/XXXX/','uid':'1','time':'1254711261'};
    var ajaxurl = 'http://XXXXXXX.com/XXXX/wp-admin/admin-ajax.php', pagenow = 'profile', adminpage = 'profile-php';
    //]]>

    I tracked down the admin-ajax.php file and it does set the content to text/html instead of text/css but when I changed the content to text/css, it didn't fix the problem.

    I really don't know what I'm doing. Can someone tell me where the html/text setting is coming from? If I change it, can I fix the problem?

    There's nothing about text/html in the php.ini file on my server.

    Suggestions?

  15. @UUCamper: I assume you are only seeing the issue in Firefox?

    It is hard to diagnose this issue without seeing the HTTP headers as there are the usual cause of this type of problem - Firefox is very strict about interpreting things the way the server says they should be interpreted whereas IE will quite happily ignore the server and do something else which can cause security issues and other strange behaviour.

    It would be really useful to see the headers or get temporary access to a low rights account on the WordPress site to diagnose.

  16. devinrayolsen
    Member
    Posted 4 years ago #

    I don't have the same issue of my backend control panel looking like that, but I do get a nasty error from FireFox that states:

    Error: The stylesheet http://www.devinrolsen.com/about/ was not loaded because its MIME type, "text/html", is not "text/css".
    Source File: http://www.devinrolsen.com/about/

    I have gone through and created a custom php.ini file (due to hosting setup) in my root dir of the site and changed the char type to not include quote like you suggested. But the error still remains.

    Here is the output of my header via FireBug.

    Date Tue, 13 Oct 2009 19:10:08 GMT
    Server Apache
    X-Powered-By PHP/5.2.2
    X-Pingback http://www.devinrolsen.com/xmlrpc.php
    Expires Wed, 11 Jan 1984 05:00:00 GMT
    Cache-Control no-cache, must-revalidate, max-age=0
    Pragma no-cache
    Last-Modified Tue, 13 Oct 2009 19:10:08 GMT
    Keep-Alive timeout=1, max=500
    Connection Keep-Alive
    Transfer-Encoding chunked
    Content-Type text/html; charset=UTF-8

    in my custom php.ini file I have added the two settings hoping it would fix my issue but thus far has not.

    default_charset = utf-8
    default_mimetype = text/css

    Anyone know whats going on? url is http://www.devinrolsen.com

  17. llizard
    Member
    Posted 4 years ago #

    This issue is resolved with my free host as well. Their tech department made the necessary changes to php.ini files that are not accessible to the general public. (I do not know exactly what was done.)

  18. mighty_mt
    Member
    Posted 4 years ago #

    We have WordPress running on a server on the local network and I also had this problem (Dashboard CSS not loading) yesterday.
    But in my case it was only happening on my computer and in FF as well as IE, so I had to track this down locally. It tured out that my anti virus program (Avira AntiVir Pro), namely its WebGuard was the reason. Disabled this and it works again...

  19. lexpresso
    Member
    Posted 4 years ago #

    I had this problem with only the Add New page of my Dashboard. My site had been hacked and a rewrite rule inserted into the .htaccess file. Make sure you remove all the inserted code at the end of your .htaccess that is not supposed to be there. It's pretty clear what is not supposed to be there.

    However, while looking, I found this post about the css headers being ignored because of charset misinterpreted. Here's the post:

    http://blog.ftwr.co.uk/archives/2009/09/29/missing-dashboard-css-and-the-perils-of-smart-quotes/

    I'm only posting here because it seems that the issue was never resolved. Now send me my $100 bucks…I really need'em ;)

  20. insistimento
    Member
    Posted 4 years ago #

    In my case, I had this problem, because my htacces has these lines:

    RewriteEngine on
    RewriteRule ^(.*)\.css$ /wp-content/plugins/script-compressor/jscsscomp.php?q=$1.css [NC,L]

    I've solved my problem eliminating these lines from my .htaccess.

Topic Closed

This topic has been closed to new replies.

About this Topic