Sapphire style for K2 WordPress theme

Sapphire custom style for K2 WordPress Theme

Yesterday I’ve build a new K2 style based on the legacy Sapphire 1.0 WordPress theme by Michael Martine. This is the result of my love to the blue bend of Sapphire and the versatility of K2.

As you can see in the footer of that blog, I’m using my Sapphire 0.1 style right now. So if you like the look and feel of that blog, don’t ask yourself and download Sapphire 0.1 for for K2 !

To install it, unzip the archive to your /wp-content/themes/k2/styles/ folder.

My First WordPress Patch !

Last week I’ve submitted a patch to the WordPress open souce project. This tiny patch fix a little bug on Kubrick default theme which didn’t display the list of comments associated with a page. I’ve spotted that bug some months ago when working on my e107 to WordPress import script. As you can see in the trac ticket, my patch was committed in the trunk of the project, and you can expect to see it in the next 2.2 version release.

How to Convert a Png image to a Website Icon (favicon)

I know how to convert a bitmap image to a website icon, thanks to the following one-line linux command:

bmptoppm favicon.bmp | ppmtowinicon -output favicon.ico

This will convert the favicon.bmp file to favicon.ico.

Today I needed to do the same with a Png file as input. After some tests, I found the corresponding command:

pngtopnm -mix favicon.png | ppmtowinicon -output favicon.ico

This work well, but if the original .png file has an alpha channel, it will be replaced by a white background.

To override this default behaviour, add the background option to pngtopnm. For example, if you want a blue background, the command to use is the following:

pngtopnm -background=rgb:00/00/ff favicon.png | ppmtowinicon -output favicon.ico

In here, the 00/00/ff parameter is the hexadecimal conversion of RGB encoding of the blue color.

By the way, if you need more informations about website icons, I advise you to take a look at the favicon wikipedia article. Here you will find useful tips about the conventions to apply in order to have a favicon supported by most (if not all) major browsers.