• 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='https://(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='https://(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 &).

Viewing 15 replies - 1 through 15 (of 19 total)
  • 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).

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

    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!

    Thread Starter Jonathan Sulo

    (@jonathansulo)

    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.

    Thread Starter Jonathan Sulo

    (@jonathansulo)

    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.

    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….

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

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

    Would be willing to help.

    Thanks Westi, hooking up with you on Twitter.

    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!

    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: https://blog.ftwr.co.uk/archives/2009/09/29/missing-dashboard-css-and-the-perils-of-smart-quotes/

    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.

    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” “https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;
    <html xmlns=”https://www.w3.org/1999/xhtml&#8221; 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 = ‘https://XXXXXXX.com/XXXX/wp-admin/admin-ajax.php&#8217;, 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?

    @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.

    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 https://www.devinrolsen.com/about/ was not loaded because its MIME type, “text/html”, is not “text/css”.
    Source File: https://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 https://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 https://www.devinrolsen.com

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Dashboard CSS not loading in Firefox’ is closed to new replies.