This guest post was submitted by Joseph. If you have WordPress knowledge and are interested in writing a post for Hack WordPress, please contact us.

This is the story of one man’s laziness and his quest to build a simple website that any client of his could edit. And leave him alone after the design was done.

I started doing this because I was tired of editing pages in Dreamweaver and uploading it each time a client wanted one word changed in the third sentence of the fourth paragraph on the About Us page. WordPress has a very convenient page functionality, and I decided to make the best of it. Here’s how you do it…

First off, you have to work on the design. You could always start with one of the many WP themes out there. Once you decide on one, though, you need to lose all the peripheral pages. Delete all the php files except for the header, footer, page, and the sidebar (if there is one). Keep the search file as well, for the time being. Then, rename page.php to index.php. Now you’ve gotten rid of the extra files, but many page templates have unnnecessary blogging-related stuff: trackbacks, comments and the meta bits. Delete them all. They usually come wrapped in little divs called “postmeta” or “postmetadata”, or something on those lines. Essentially, look for the divs that contain the tags the_time, the_author, the_tags, the_category, comments_popup_link and so on. You can find more of these template tags here. All you actually need from this page is probably the_post and the_title. Yes, really.

Now, lets get to the header and footer files. In the <head> section, delete the lines which contain links to the RSS feed (rss2_url) and the pingback URL (pingback_url). Similarly, in the footer file, delete any links to RSS feeds. That’s all there is to it.

When you get to the sidebar, you need to make some decisions, based on your requirements and on your theme. First off, is the sidebar widgetized? If it isn’t, get that widgetizing done. Did you delete functions.php a while back? Sorry. Restore it from your recycle bin… you’ll need that. Once your sidebar is widgetized, browse over to the widgets section and add widgets you want. Don’t throw everything in… you don’t need Akismet stats, for heaven’s sake.

Now we get to the search function. WordPress doesn’t search pages. Don’t ask me why. They just don’t. You’ll need a plugin like Search Pages. But first, figure out if you need a search page or not. If it’s a five page site, it’s highly unlikely anyone would need to use the search function. If your site runs into several dozen pages, keep the search function, unless your navigation is idiot-proof. Depending on whether you’re using search or not, keep or delete search.php. If you’re keeping it, don’t forget to remove the meta-stuff from the search results page.

You’ll need a contact form. What’s a static site without a good old contact form? Use one of the many plugins at the WordPress plugin directory.

Your theme is now ready, and you need to strip your CSS file a bit. No point in cluttering up your CSS with classes and ids you’ll never use.

Finally, if you’re doing it for clients who want to edit pages themselves, you don’t want them fooling around with the site settings and themes and plugins. There’s no telling what havoc they could wreak. Not to mention, create more work for you. This is where a very handy plugin comes in: Ryan’s Simple CMS. Set your client as a new user with Editor permissions, and they get a nice clean pages-only backend. They won’t keep writing new posts and wondering why the new page isn’t up. While you’re at Ryan’s you could try his Simple CMS theme as well, to help with your theme. It’s even got a nice Suckerfish menu built in.

Don’t forget the most important thing of all: setting a page as the front page for the site.

Digg This! | Stumble it! | Add to Del.icio.us | | Print This! |

There Are 13 Responses So Far. »

  1. 1 Ryan
    Sunday, April 27th, 2008 at 3:08 am

    Glad to hear you appreciate my plugin :)

  2. 2 Angela Henderson
    Monday, April 28th, 2008 at 12:06 am

    Wonderful! I had been looking for this very information recently!

  3. 3 Jermayn
    Wednesday, April 30th, 2008 at 1:03 am

    I have just finished doing this myself and was going to create a post about my experience.

    I would also suggest to actually edit the backend and get rid of the extra stuff in the main menu.

  4. 4 Joseph
    Wednesday, April 30th, 2008 at 4:37 am

    Editing the backend by hacking the code is one way, but that means additional work during upgrades. Ryan’s plugin does it quite well…
    When logged in as a “client” all I see on my dashboard are links to New Page, Manage, Uploads, and Log Out. There aren’t even any WP related feeds on the dashboard.

  5. 5 Josh Fialkoff
    Sunday, May 11th, 2008 at 6:43 am

    I’ve been using WP as a CMS for several small sites I have done for friends and relatives…

    My question is this: What do y’all think of using WP as a CMS for sites with 100+ pages? Are there problems that will be encountered as the scale increases?

    The biggest problem I see is the navigation.

    I have not found a *great* plugin for navigation that allows drop downs and sub-menus. I did just see this post today: http://www.darrenhoyt.com/2008/02/12/creating-two-tiered-conditional-navigation-in-wordpress/, but I have not tested it yet.

    I’d love to get feedback on this thought… if WP works for large-scale sites, I think it would be a great business tool!

    Thanks,
    Josh

  6. 6 Tom
    Monday, June 2nd, 2008 at 5:17 pm

    I have spent weeks trying to find an answer to this question and cannot find anything:

    Is there a way to use WordPress to add comment functionality to pre-existing static pages? In other words, I have 80 pages that are essencially static. I would like to add a way for people to leave comments and read other people’s comments on each of my 80 static pages. Each page is written in php, so I would like to add some php that would call wordpress and have it manage comments for that particular page.

    I have already installed wordpress in a blog directory on my site, but I cannot figure out how to get wordpress to store and retrieve comments based on which static page I am calling it from. I basically want to have a page like the one I am writing on now (minus the sidebar). I just want to display the unique text and pictures of each static php page, and then have a nice way to view and submit comments. But I do not want to write the entire site in WordPress.

    Any suggestions?



Leave A Comment