The Daily T -

WordPress as a CMS revisited

I promised I would post something about my experiences with using WordPress as a CMS. Well, the site I was working on, a portfolio site for my wife, is now online.

The site, I’m happy to report, gets by using mostly standard WordPress features — posts, categories, pages, comments — and where I had to step outside the standard I found the theme/template system relatively easy to work with. I’ve structured the site into categories (some with sub-categories) and pages. Portfolio entries are stored as blog posts and appears under the category they’re assigned to. Easy-peasy.

Each entry is displayed as a thumbnail picture. On uploading images, I’ve set up the Flexible Upload plugin to resize all images to the standard size as well as a thumbnail copy with a certain name. When the posts are listed, I pick out the first image url of the post (each portfolio entry can contain several images) and display the thumbnail version of that image.

When you’re on a category page, such as the Illustration page, each portfolio entry is fetched using Ajax on click and displayed with a nice fade out – spinner – fade in effect using Mootools. WordPress has a template called “single.php” that holds the block content for a single blog post, and I’ve added a switch to this template so when my Ajax request gives it an extra variable I know not to print all the container tags — on an Ajax request only the actual post contents are printed.

The top level menu is hardcoded in a template include, as it contains links to both categories and pages.

Editable texts around the site are also saved as Pages and given names that correspond to the header the text appears under. This works perfectly for a relatively simple site like this where there’s not much ambiguity as to where the text appears. Had the site been more complex I probably would have considered looking into inline editing links.

It was nice to see WordPress concepts plug so readily into a normal site, and I’ll probably use it again. The concept of “The_Loop” takes a little to get into, it’s both a normal loop of posts and a kind of context in which functions can be called and automatically refer to the current post. I would have preferred this implemented as a loop with the post as a simple value object, but it works ok when you get your head around it. WordPress as a CMS revisited