WP Themes: Lessons from Gangway

Gangway‘s another Performancing offering, this time coded by Forty Media. Like most I’ve checked out, it’s a lightweight, fast-loading theme with three columns; the content’s on the left, with the two sidebar columns on the right side of the screen. The theme does a couple nice things in the sidebars, which is why I wanted to look at the code. Gangway’s designed to support multiple users, though that wouldn’t handicap a single user who chose to go with the theme. Aesthetically, the theme’s pretty dull, but that could be fixed by tweaking the CSS.

My notes follow:


The WordPress Style

Architecture: Theme support in WordPress encourages, but doesn’t require, both modularity and standardization. While only two files (style.css and index.php) are necessary to create a non-trivial theme variation, WP’s display engine recognizes a dozen-and-a-half file names and uses them in appropriate places if they are present. This creates a powerful incentive for most designers to stick to the standard file set. Those who need (or prefer) to use a non-standard file set are accommodated by what I take to be simple PHP coding. (Recall that one of my purposes, here, is to learn PHP; I’m not there yet.)

Presentation: Mechanically, WordPress is like lots of presentation engines: It pulls content (including menues) from a database, which it wraps in (X)HTML using a combination of PHP, PHP extensions, HTML tags, and the flags (the strongest are usually but not always labeled “class”) which give CSS the hooks required to control presentation. This is stuff I understood in principle when I started this little project; what I’m about, these days, is coming to grips with the details. The reason I mention it now is that I’m annoyed with the CSS that styles Gangway.

Style: In the past week I’ve called LightCMS “well-crafted” (Sreejith is a code artist), Cutline “workmanlike” (Chris Peterson’s a problem solver), and ModernPaper “delightful” (Brian Gardner’s unusually disciplined). Although they’re very different in detail, all use the same basic CSS vocabulary for describing/organizing the document. Since I don’t follow the CSS discussions, I don’t know what standards someone’s trying to enforce, but I’ve read enough code in my life to have preferences. CSS is a rather spare coding language, but you don’t need to look at many stylesheets to learn that there are a variety of coding practices (normally I’d call these “styles,” but that would be confusing), and that some of those practices are more readable than others. Gangway’s style sheet fails the readability test.

I have two problems with Gangway’s CSS: It doesn’t follow what seem to be the WordPress community’s labeling conventions, and it’s “clever.” I’m sure there are good reasons to call the sidebar “addbar,” the header “branding,” and the meta area “tools,” but if this theme called the standard WP design elements by their common names it would remove a barrier to understanding the (GPL’d) code. The cleverness issue shows in the style sheet’s arrangement; Gangway’s coder likes to group things for efficiency. Since CSS display reflects sequencing, it’s possible to code for performance by sacrificing readability; that’s what I think is going on, here. Can’t say I like it….


Despite my complaints, this is solid code. I’ve learned what I wanted about sidebar design, which was my main purpose; I can move on to something else. Ajax-Berlee, methinks. Ought to be an interesting encounter.