Thinking » Tags » navigation
Ever since WordPress 2.5 was released, we’ve been pushing the boundaries of WordPress as a comprehensive CMS.
WordPress offers a wealth of plug-ins that extend the limitations of its reasonably light core; we’ve even contribued a couple of our own back to the community. But if you like to make slim, fast websites – like we do – you know that sometimes the plug-ins, and their overhead, are overkill.
Here are five power tips for template developers that address common CMS implementation challenges with solutions that are not well documented or not entirely intuitive. Please note that all of the code here was written for and tested with the latest version of WordPress (2.7.1). Some of the functions may not be compatible with older versions, or may require some initialization (i.e. global $post).
Most of our website design projects involve a first design for a new site or web application, or a complete redesign from the ground up. A home page and design “refresh”, however, can be a smart, often overlooked investment in a site’s vibrancy, particularly in times when budgets are tight and that vision of a redesign might be out of reach.
Of course, not all sites are suited to an evolutionary (as opposed to revolutionary) face lift. Putting lipstick on that 10 year old site with the scrolling marquee, blocky graphics, and green background is probably not a smart investment. But there are many websites with reasonable aesthetics – maybe a few years old – that don’t need to be torn down and rebuilt. Some creative thinking about how existing structural elements can be refined, coupled with a face lift of the home page’s content and, perhaps, key landing pages, can offer real bang for the buck.
Recently, we did just that for the New England Law Library Consortium (NELLCO).
Increasingly, we’re building sites – like our own – that are completely managed by WordPress. WordPress makes it very easy to output a list of pages using the wp_list_pages function; you can control depth levels, surrounding tags, and even explicitly exclude certain pages. And with the precise classes that accompany the output HTML elements, you can finely control the output with stylesheets.
Many sites, also like ours, list pages only under the current top level page (or, put another way, pages in the current section) in a sidebar. For example, if you go to the Services page, or any of the pages inside that section, you’ll notice a box atop the right sidebar called “More in Services” that provides navigation within the Services section.
Taking advantage of the wp_list_pages function to create section-based navigation for sites with two levels of page depth is a pretty straightforward matter, as I’ll explain. But how do we efficiently output section based navigation for sites with 3 or more levels of page depth?