Cleaning Up My WordPress Theme

Today I spent at least five hours working on my WordPress theme. I haven’t really done much programming in XHTML/CSS in the past year, so it took quite some time to get into the code again. The stylesheet for the layout was a complete mess, and while I updated the WordPress software to 2.8.2 last saturday, some of the PHP files in my theme were “leftovers” from the old version. You get the picture.

After what I did today, the stylesheet looks much better, and major parts of the XHTML are way cleaner than before. As a result, the code validates again properly via the W3C Markup Validation Service. Now, let’s have a look at what changed for someone who visits the site.

I did a complete overhaul of the metadata for each entry (time and date of the posting, categories, tags and the link to the comment area), so the distinction between the actual post and the metadata appears clearer. The same was done for the metadata in the comment area, aka the single post page. This went along with some cleaning up of font sizes, colors, hyperlink behaviour and of course lots of wrestling with the infamous paddings and margins.

The second, big change concerns the comment area. I’ve tweaked all the forms (the input fields for name, e-mail and website, as well as the input area for the comment text), and brought the formatting of the actual comments in line with the rest of the site layout. Last but not least, I implemented support for Gravatar icons in the comments. Since WordPress supports this since version 2.5, it was only a matter of adding some PHP to the comments template. Visitors who already signed up with Gravatar and uploaded an image will now see it appear next to their comments.

After today’s programmathon, there’s not all that much more to do. I might tweak some small things here and there, but don’t expect any revolutionary changes in the near future… unless I decide to rebuilt the layout from scratch on a whim. 😉

Leave a Reply