Monthly Archives: December 2008

Notes on wordpress.com and CSS

OK, we decided to pay WordPress in order to be able to use the cool CSS upgrade. It’s a pretty reasonable deal, when considering the cost of Crow Caw Music Works’ previous web hosting arrangement.

The way you give it its CSS is a little clunky. You have to enter it in the box under Appearance > Edit CSS in the Dashboard. And once you do, it strips out all the comments and space. So if you want an annotated/commented version you need to keep it in a separate document somewhere. Here’s a good idea: why not save it as an OpenDoc format file in the media library attached to the site?

But the only text-type format that it will let me upload is a .doc type. Hmm. So I guess I’ll have to keep it in WordPad or MS Word format, and either cut and paste or save it as text and paste it into the Edit CSS box each time I want to try something new. That certainly isn’t very elegant.

The solution is: keep a text file on your computer with the current version of the CSS that works (and if you’re a cautious person, the last few working versions as well.) Then create a page in the site that’s out of the way. You can then paste the CSS onto that page, and wrap it with the “shortcodes” that indicate to wordpress not to format it. That was if there’s ever a problem you have the CSS right there on the site. This has the beauty that you can work on the site on any computer that can connect to the net anywhere, and save your CSS file to it.

You could also go through the hoop of renaming the CSS file to stylesheet.css.doc which will allow you to put it into the Media Library. That will allow you to keep a lot of back versions too. The problem with the WordPress Media Library is that it’s not organized in any way that I can see, and once you have a bunch of items it’s going to get pretty unwieldy to keep track of.

(Update 23 Feb 09) Well, if you’ve read this far or elsewhere, you probably know there are a lot of possible solutions here. In my case, I also paid for the space upgrade, which allows you a lot of extra other features, such as the ability to host mp3s, and upload and store a lot of different kinds of files. Especially “odt”s, which are “OpenDocument” format files, which are created by the OpenOffice suite. I think I’ve written about this somewhere else, but in a nutshell it’s a free, Open Source replacement for Microsoft Office. It’s well worth a looksee, and probably indispensible if you’re a Linux user. So now I can save my CSS file as an ODT file and store it in the Media Library.

Just as easily, I can simply cut and paste it and include it on a page in wordpress. The problem with that approach is that wordpress gets confused and tries to interpret the CSS as CSS rather than just presenting it as text. wordpress tried to give a wrapper to allow you to circumvent that problem, but for some crazy reason it doesn’t wrap lines so you get lines that are 1000 characters long.

Last edited 20090612