Building a coffeehouse from WordPress

Note: This post is over 2 years old. You may want to check later in this blog to see if there is new information.

The Blue Heron Coffeehouse Rough DraftI’ve recently discovered that it’s relatively simple to turn WordPress into a CMS using basic Template Tags and page templates. This isn’t new information by any means, and is something WordPress was meant to be able to do. But I’m planning to strip down and package my source files when I’m finished with the site so that people can work from them and hopefully get some ideas.

Some of the features that I’ve included are a moo.fx accordian effect for the about information on the main page, an integrated ZenPhoto gallery with Lightbox, an easily edited daily menu and a news page. The news page and daily menu display simultaneously, but are editable separately in the back end. The code to do this is pretty simple, you just have to make two separate queries. Fist I made a news template called page-news.php. At the top of the page you place the code:

PHP:
  1. <?php /*
  2.     Template Name: News
  3. */ ?>

Then you create the template for the news page. Mine has two columns, the left for news, the right for today’s menu and a DB query for each. The fist query calls for all the posts in the category “News”:

PHP:
  1. <?php query_posts(‘category_name=News’);?>

Then an if (have_posts()) loop takes over from there, formatting the posts for the column. Once that loop has finished I end the div and begin the second column with a page query:

PHP:
  1. <?php query_posts(‘pagename=todaysmenu’) ?>

Then you can run a simplified loop that doesn’t display titles, authors, dates or links. Just the content of the page within the div for the menu. Then create a new WordPress page using the news template, give it a slug of news, make a link to “news” from your main menu, and presto, a dynamic news board with a static menu page, both editable separately on the back end! I know, it’s not that difficult, but I thought I’d share.

Source code for the news page template: page-news.php.zip

» » » » » » »

Comments are closed

Comments are currently closed on this entry.
  1. Ross Johnson 08.20.06 / 9am

    Came across this on digg again, and have wanted to do the same thing myself for quite some time!

    I was never sure if it was worth trying to convert it since I am already pretty framilier with WordPress, or if I should pick up a freeware CMS such as Nuke and go from there?

    Great post -Ross

  2. brett 08.20.06 / 9am

    I’ve set up clients with Joomla and PHPNuke, and it’s overkill for something like a coffeehouse. Wordpress is *perfect*. I’m in love with the simplicity of it, and now that I’ve figured out how to create the static pages and generate a front page that can pull in different elements, I can’t say I’ve found anything better. The plugins available, including ajax contact forms and event calendars, help it rival it’s bigger siblings in the open source CMS arena. I may play around with upgrading TinyMCE a little bit, but for the most part I end up taking away features from the editors on Joomla because it just allows my clients to screw up their pages. I handle all of the styling, they don’t need the freedom to turn their text orange on a purple page. ‘Nuff said.

    I don’t even use the rich text editor in WordPress myself, I prefer the stripped down quicktags version. But I’m a control freak.

    Quick list of reasons why WordPress is better than Joomla or Nuke in small applications:

    Faster
    More AJAX
    Easier templating, more template tags
    Less code in the source, easier to manipulate SIMPLICITY

  3. Ross Johnson 08.22.06 / 9am

    Those are my thoughts exactly. My only reserve would be a situation where the website might out-grow a wordpress powered CMS and then they are stuck paying a bill to install a more advanced CMS.

    Great post and insight!