Tagged: Wordpress

Thematic: the final word in WordPress themes

Modular, Extensible

I’m a sucker for clean, well-designed code. I like modular, extensible architectures. I like change.

As a consequence, I struggle periodically with the theme of my website. Not that I am a designer and it is certainly not the most productive use of my time, but what can I say. The point is, I was never really happy with the infrastructure I had at my disposal (I am never happy with the designs that I come up with, so thats another story). Until now.

One of the main barriers in designing a custom theme is that you don’t want to scratch. It is just too much work, and why do it when so many others have already done all the hard work for you? It pays to be lazy! So I have always looked around for good starting points to build up custom themes on.

I started out with Sandbox, a semantically rich theme that allowed extensive customization just using CSS. However, styling via CSS can only get you so far. Sometimes you really do want to make changes to the underlying PHP, for instance.

My next setup involved a base copy of Sandbox on which I layered my changes. In order to accommodate changes to the underlying Sandbox code, I used Mercurial with patch queues (the mq extension). This was much nicer, since it was easy to keep up with changes to the core Sandbox and leverage the work that was being done by others. But it was still cumbersome, since once in a while I would run into conflicts that I would have to merge manually. And it was still not a clean setup.

My ideal setup would have been to keep my changes completely distinct and isolated from the underlying theme. A setup that would allow the underlying theme to evolve independently, while my changes continue to work without any additional work.

Thanks to improved support for child themes in WordPress 2.7, and some fantastic work done by these fine folk, I have realized this ideal setup.

You see, I recently started working on a new website for my wife (it is not live yet, but will be soon). In the process of building her website, I was exploring the so-called WordPress Theme Frameworks. After some playing around, I settled on using Thematic. I started out by cloning the Thematic repository. Locally, I was using git-svn to manage the code changes. Thanks to git-rebase, it was not that hard to keep my changes up-to-date relative to a rapidly evolving Thematic code base.

But soon enough, Thematic had enough hooks, filters and features that I could do all the modifications without modifying a single line of Thematic itself. Now, all my changes are contained entirely within a child theme. How it is possible? Well, Thematic happens to be pretty much the most child-theme friendly framework that I could find. It is really easy to customize.  Several child themes are already available for immediate use, and it is trivial to develop your own child theme.

This blog is going to run on a Thematic child theme. Changes are going to be incremental, but I don’t need to worry about keeping them in sync with Thematic, and I get to leverage the improvements being done in the core them for free! You can also take a sneak peak at how we are using Thematic for my wife’s new website

Code updates

I have finally gotten around to updating my [[http://floatingsun.net/code/wordpress-widgets|Wordpress widgets]] — UTW Related Posts and Sub pages — to work with the latest version of WordPress. If you have been using these widgets, please try them out and let me know if they work for you.

There are some changes in the theme itself. I have modified Sandbox slightly to present the meta info about posts slightly differently. For posts with a lot of comments, the comments should now appear paged. I have a version of comments-paged.php for Sandbox (for use with the [[http://www.keyvan.net/code/paged-comments/|Paged Comments]] plugin) — if you need it, drop me a note.

A new release of WP-Dokuwiki is around the corner as well, so keep an eye out for it!

700 and counting

I’ve just upgraded this blog to WordPress 2.2.1. But mostly I’m writing this post so that my post count can be **700** :-D This blog is now a little [[http://floatingsun.net/2004/04/30/to-blog-or-not-to-blog/|more than 3 years old]], with around 1200 comments to boot. While I have no intentions to climb to the A-list, it gives me a warm fuzzy feeling nonetheless.

Fresh look

If you have been checking out my website on a daily basis the past few days (yes yes, I know many of you have nothing better to do! :p ), you will have noticed that it has undergone several changes. The most visible of course, is the new look. So if you’ve been hiding in the comfort of your feed readers, here is your chance to get out and enjoy the fresh new look on [[http://floatingsun.net|floatingsun.net]] :-)

A few days back I had [[http://floatingsun.net/2007/05/29/watch-out/|announced]] that changes were upon us. I usually don’t follow up to claims like that fully, but this time around I think I’ve done a pretty good job.

The first major change I made was to re-organize the content on the website. As I outlined in a [[http://floatingsun.net/2007/06/07/update-your-bookmarks/|previous post]], this much needed change was actually suggested by a friend first. I think now the content structure is much cleaner. No more do static pages (on code, articles, research etc) have to live under “/blog”. The “blog” itself (basically the conventional reverse chronological ordering of posts) has been moved to “/weblog” instead. I had to do this because I didn’t want existing links to content under “/blog” to break.

Of course, to make everything work I had to do some [[wp>.htaccess|htaccess]] magic under “/blog” to make sure all links are redirected properly. I’m also trying to be a good samaritan and sending the [[http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection|HTTP 301 code]] (moved permanently) so that search engines and other crawlers can fix their indexes appropriately. This should also hopefully make sure that my search engine rankings are not affected.

Also, if you noticed, I have gone back to a different [[http://codex.wordpress.org/Using_Permalinks|permalink]] structure. A long time back, I [[http://floatingsun.net/2005/08/16/permalinks-updated/|had argued]] that having a post ID based permalink was better. In hindsight, I don’t think it worked out very well. First of all, having the post title in the URL seems to work better for search engines. Secondly, if people link to my posts, having the title in the URL itself gives potential visitors some idea what the post is about, instead of having to grabble with a bunch of random looking numbers. And finally, most analytics software (in particular, [[http://analytics.google.com|Google Analytics]], [[http://awstats.sf.net|AWstats]], Slimstat/Measuremap/Mint etc) don’t work very well with numerical URLs — as in, many of them implicitly assume some kind of content information to be present in the URL.

Anyways, as before I didn’t want my old links to break. So I used the //excellent// [[http://www.deanlee.cn/wordpress/permalinks-migration-plugin/|permalinks migration plugin]]. It works like a charm, right out of the box! Its a little funny, because people accessing old URLs will actually go through two indirections before getting the real URL: first “/blog” will be stripped out of the URL, then the numerical URL with post ID will be re-directed to its new sanitised URL (with the post title). The migration plugin also sends 301 re-directs, so hopefully all will be well in search engine land. Though looking at the stats from the past few days, I think there has been a //slight// dip in hits — but that might just be coincidental.

The second major change is the new look. I’ve always wanted a theme that uniquely mine, but since I always ended up using [[http://getk2.com|k2]] or some other standard theme, it never quite happened. The fact that I’m pretty bad when it comes to colors and design doesn’t help either. Fortunately for me, recently the [[http://www.plaintxt.org/themes/sandbox/|Sandbox theme]] got some love and I decided to give it a shot again (yes, I’ve tried sandbox earlier on this blog, but it didn’t last). The great thing about Sandbox is that it has a very rich semantic markup, and so its possible to do a lot just by using CSS. Since I didn’t want to muck around with PHP much, thats one less thing to worry about.

And so this theme was born. It is unimaginatively named floatingsun and it is unlikely that I will make a public release anytime soon. It is definitely not completely original in the sense that layout (and even the color theme) has been inspired by the beautiful [[http://www.binarymoon.co.uk/projects/regulus/|Regulus]] theme. But it //is// unique in the sense that I pretty much did the CSS from scratch, including the layout and the colors. For colors, I played around a lot with some color schemes (check out [[http://kuler.adobe.com|Kuler]]) and eventually decided to pick up colors from the [[http://www.oxygen-icons.org/|Oxygen]] [[http://kde-artists.org/Oxygen-palette|color palette]].

I’m also integrating various plugins into the theme as and when I go along. I’m maintaining all my changes as a patch on top of sandbox, so when a new version of Sandbox comes out, its easy for me to upgrade. I’m also looking forward to the recently announced [[http://www.sndbx.org/|Sandbox Design Competition]] — while I fully intend to stick to this layout/color combo for some time, there’s no harm in picking out the best from from the lot and incorporating them in my theme :-D

I’ve also ditched most of the bundled widgets. Instead, I’m using some fabulous plugins by [[http://rmarsh.com/about-2/|rmarsh]] — [[http://rmarsh.com/plugins/similar-posts/|similar posts]], [[http://rmarsh.com/plugins/recent-posts/|recent posts]], [[http://rmarsh.com/plugins/recent-comments/|recent comments]] etc. None of these plugins come with widget support, so I hacked up simple wrapper widgets that call the plugins. I’ll put up the code for these widgets shortly. One of the best things about these plugins is that they can use the [[http://rmarsh.com/plugins/poc-cache/|Plugin Output Cache]] plugin, so hopefully that’ll ease up the load on the server even more.

I’ve not used any background images so far. The icons all belong to the [[http://famfamfam.com/lab/icons/silk/|silk icon set]]. I’m still debating if I should spend time trying to come up with a logo — we’ll see how that goes. Its still a work in progress, there are a bunch of things I still need to do, most notably styling of comments, post meta-data and better UTW integration.

I’d love to hear any comments/suggestions on this new look!

Update your bookmarks

As I mentioned in an earlier post, I am in the process of re-organizing my domain. The first phase of that is complete, as is witnessed by the ugly looks of this website. Any URLs under http://floatingsun.net/blog/ should correctly redirect to http://floatingsun.net/ — let me know if you see any problems. I’m expecting I will lose some search engine karma due to this shift, but hopefully I will be back in the ranks before too long.

I am also trying to rebuild a theme on top of [[http://www.plaintxt.org/themes/sandbox/|Sandbox]], so I’ll be keeping a close watch on the [[http://www.sndbx.org/|Sandbox design competition]]. This new site is also running the latest and greatest [[http://wordpress.org|Wordpress 2.2]].

Thanks for your patience.