Introducing Carrington

One of the best things about WordCamp Utah was the opportunity to launch Carrington – a new theme; but more importantly, a new theme framework for WordPress.

Carrington

I wasn’t exaggerating (that much) when I characterized Carrington as the best thing since the wheel and sliced bread. I really feel like this has the potential to be the largest contribution I’ve made to the WordPress community. I’m very excited about it.

Enough self-congratulation – on to the good stuff.

What is Carrington?

Carrington is an attempt to better abstract WordPress theme organization, and simplify commonly needed theme functionality.

At the moment, Carrington is basically three things – in this order:

  1. A developer friendly theme and conventions-based templating system.
  2. A set of best practices for theme organization.
  3. An elegant, semantically rich WordPress theme for end-users with advanced features (like SEO-friendly AJAX loading of comments and archives and drop down navigation menus).

How Do I Get It?

Carrington is released under the GPL, just like WordPress. You can download it from the WordPress theme directory. You can also purchase Carrington from the Crowd Favorite store. This isn’t required, as we also make it available for free; but Carrington is definitely a :scare: premium :/scare: theme and has real value. The more people purchase it, the more we can dedicate resources to improving it and building new Carrington themes.

Download Carrington Blog version 1.1

Carrington Blog is our first theme released on the Carrington framework.

Changes in Version 1.1

  • There is now a setting to allow you to set how many posts should appear on the archives pages (seperately from the home page).
  • Added parent-{page-slug}.php support to enable custom content display for sub-pages.
  • Support cat-{slug}.php, etc. template support throughout all top level directories (header, footer, sidebar, etc.).
  • Some IDs were converted to CLASSes to remove in-page ID conflicts (due to AJAX loading of templates).
  • Firefox 2 compatibility for drop-down menus.
  • Improved ShareThis compatibility with AJAX archives loading.
  • Additional classes for misc. support.

Why Did We Build It?

At Crowd Favorite we build a lot of “WordPress as a CMS” powered web sites. WordPress makes a great, easily customizable, CMS back-end; and Carrington is the perfect compliment for it on the front-end.

We wanted to simplify how we built these highly customized sites. We wanted to make them easier and faster to build, and simpler to maintain. Carrington is our solution.

Framework = Convention Over Code

The main win from a framework is the move to convention over code. Instead of writing a bunch of code to accomplish something, using the supported naming conventions and the framework takes care of the heavy lifting for you.

By standardizing file naming conventions and template hierarchy (while retaining compatibility with WordPress theme standards), and including functionality to act on these standards, Carrington makes it dead simple to implement commonly requested theme features. These include a custom design/format for:

  • posts in the “Tech News” category
  • posts by a Joe Smith
  • posts by contributing authors
  • comments by the post author
  • comments by registered users
  • search results
  • custom footer/header/sidebar for page X or category Y
  • etc.

Carrington allows you to stop cluttering your templates with conditional logic and just build your templates. The framework will take care of the logic for you.

The Details

The WordPress engine prepares data for a page and hands it off to the theme and it’s the theme’s job to make that look right to the end user. Carrington takes that data, and makes a bunch of intelligent decisions about how the page should be displayed.

The override system looks at the page to display, and the available templates, and goes through a series of checks to see which templates to use at each level. Don’t worry; you aren’t stuck with the evaluation order we chose. The order in which the fallbacks are processed (and the final decisions on templates) can be overridden by plugins using actions and filters – using the standard WordPress system. This means that if you want your author role template to be more important than your category template (or vice versa), it’s a simple matter of a couple line plugin (and can even be placed in Carrington’s plugins/ directory for easy distribution with the file). Of course, we are happy to provide development services to help build these plugins or customizations.

The core of the Carrington engine is in the function.php and functions/ directory. That’s where the magic happens. The rest of the theme is organized into template files in different directories. There are a lot more directories here than you normally see in a WP theme because Carrington abstracts the theme elements to their atomic pieces. This enables you to have a template that displays a post, comment1, etc.

These atomic templates enable the AJAX loading features you see in Carrington. People have long asked me to release the AJAX loading features you see on this site, but I couldn’t really do it (until now) because it required this kind of theme abstraction and most themes don’t support it.

Every directory in Carrington has a pretty thorough README file (you can also access this documentation online). These files explain how the templates in the given directory are used, and what named templates are supported for this directory. These took a while to write, and could probably use some more detail (I’m not a tech writer), but they are a very good start and have been part of Carrington since 1.0.

Online Resources

This is still a little bit in-flux, but we’ve got the following set up so far:

Carrington’s Future

Expect to see some new themes from us based on the Carrington framework in the future – we’ve just scratched the surface of what Carrington can do here. We’re excited to be bringing new Carrington-based themes to the community; and we’re equally excited to see what the community builds with Carrington.

  1. Similar to the new comment template in WP 2.7. [back]

This post is part of the project: Carrington Core. View the project timeline for more context on this post.