Customizing WordPress Templates
I’ve been doing a bunch of work with WordPress lately, mostly customizing templates and writing plugins to make it work more like a “real” content management system (CMS), rather than just a simple blogging platform.
Rather than try to explain all the technical details of what I did (I hate doing documentation), I thought I’d just show some examples from two sites that I recently worked on, GraceDC and Langham Partnership International. In this post, I’ll focus on some of the design and template related modifications I made to WordPress’ templating system to make the sites look and behave like the way they do.
General Design: The first thing you’ll notice when you load those two sites is that it doesn’t look like a WordPress blog at all, or for that matter, anything like each other. Each design and template is customized specifically for the organization. While there is some minor code reuse between the two sites, the HTML and CSS code for each site is basically unique.
Homepage: The homepage for each site is unique and entirely different from secondary drill down pages. GraceDC is probably the most complex of the two, since its homepage pulls in content from multiple sources. In general, everything on the homepage is editable from within the standard WordPress admin with the WYSIWYG, no special template modifications is required to make routine updates.
Navigation: The primary navigation is built automatically from WordPress’ page system and can support drop down menus with a custom Javascript library I wrote. GraceDC has drop down menus, Langham does not. Note that the proper navigation element also says highlighted when you browse into a particular “channel”.
Secondary Navigation: Just a simple widget which prints out all the pages in a particular channel. On Langham, this appears as a left column in the drill down secondary pages. On GraceDC secondary navigation is available from either drop down menus across the top or in the sidebar to the right.
Breadcrumb: Somewhat related to the navigation is the breadcrumb, which WordPress does not support out of the box. This basically prints out the hierarchy for the current page you’re in. It’s a minor element, but something I think that really adds to the usability of the overall site.
Sidebar: Each page has it’s own independant and customizable “sidebar” area to the right of the primary content area. For a simple blog, it’s not really necessary to have a custom sidebar on a per-page basis. But for more complicated sites with lots of content, it is definately required. The sidebar is also editable through the standard WordPress admin.
Archives: For GraceDC, the site features both sermon podcasts and announcement posts. This posed a slight problem, since sermon posts is really the primary content and should be featured above announcements. So with this in mind, the archives have been customized to separate out posts based on which category they belong in. Also, you notice that the breadcrumb for a sermon post is different than that of a general announcement.
Ok, that’s it for now. As you can see, with just a couple tweaks, WordPress can be customized into something that can work quite well for content heavy “non-blog” sites. In the next WordPress related post (whenever that might be ;), I’ll talk more about some of the plugins I wrote to add complex functionality and integrate third party solutions into the sites.
This post is republished from tantannoodles.com
