WordPress as a CMS: Pros, Cons and examples
written by Daniel Angel
⇒10 Jul 2009
When we first began the process of re-designing our site, we knew that we wanted to keep it simple and make it cms/database driven. We also knew the blog klog would be powered by WordPress. Not wanting to mix things and overcomplicate ourselves, we eventually decided to manage the entire site with WordPress. Now, WP is a heck of a publishing tool. IMHO, now no other blogging tools available out there come even close to it. However, using it as a fully fledged CMS is a whole different issue.
If you decide to go this way, keep in mind that you’ll probably come across some hurdles. Powerful as it is, a vanilla WP installation/theme combination won’t get you far, so I wanted to share some of our experiences, the issues we had and how we solved them. Hopefully it will help some people out there. This post is the first delivery.
Site structure, Menu and Permalinks
Sometimes you’ll need to go beyond WP’s conventions for menu structures, names and classes as well as the permalink structure of your site. It’s very frustrating to style a main menu without defining additional/custom classes and IDs. Enter Alex Dunae’s Classy WP list pages. This plugin gave us full control over the menu’s naming convention.
Also, we needed to keep a previously-defined URL structure. WP’s permalinks section is good, but does not provide the high-customisation degree that we needed. Michael Tyson’s awsome Custom Permalinks plugin was a life saver.
Different templates for different posts
We use WP posts as portfolio items, so we needed to treat them differently from actual blog klog posts, both visually and structurally. The problem is that the WP theme convention only uses one file for individual posts: single.php, so it posed a big problem. The solution, however, was super simple:
single.php:
if (in_category('portfolio-items-category')) {
include(TEMPLATEPATH . '/portfolio-item.php');
} else {
include(TEMPLATEPATH . '/blog-post.php');
}
Voilá! Sometimes one tends to overcomplicate things. That little code snippet was all it took to solve the problem.
Meta Information on posts and pages
You may need to store individual bits of information to retrieve/manipulate later. In our case, we needed to add additional information to each portfolio item. Things like technical specs, technologies, platforms and a single, unique identifying code for each project. WP Custom fields are your friends. You can retrieve them by using the get_post_custom(). The function returns an array that you can manipulate in any way you want.
Well, there we go. Hopefully I’ll write a couple more posts on everything we learned from this experience. If you have any questions, feel free to comment :)
Jason: 16 July 2009
Excellent site,Thanks for this great post – I will be sure to check out your blog more often.Just subscriped to your RSS feed..