Configure Wordpress As A CMS

Apr 2nd, 07

series_stamp_2of3.gifAfter wading through a headache-inducing number of Codex pages, and stumbling through various articles which briefly touch on using Wordpress as a CMS but don’t actually explain how to set it up that way… I decided to write my own version of how to do just that.

Powering your entire site (not just your blog) using Wordpress as a content manager can be done with a minimum amount of configuration, while still affording you the ability to maintain a tidy file structure, i.e. installing Wordpress to its own directory. This way, your blog “virtually” exists in the root, allowing you to create static pages and offering control over the site-wide content you develop. Yay! Let’s get started.

Step I: Install Wordpress In Its Own Directory

  1. Create a folder in your file structure where you want to install Wordpress. Unpack and FTP all the files into that folder.
  2. Navigate to the new folder in your browser and follow the prompt for setting up your database and logging in
  3. In your admin area, go to Options > General and make sure the address currently in the box labeled WordPress address (URI) matches the name of the folder you installed to, for example http://yourock.com/yourblog
  4. Change the address currently in the box labeled Blog address (URI) to reflect your root - http://yourock.com
  5. Save your changes
  6. Still under Options, go to the Permalinks tab, and change the structure to whatever pretty links you want
  7. Note: The purpose of changing your permalinks at this point is to force the .htaccess file to show up in the remote file structure, where it would normally be hidden (even if you have “show hidden files” selected in your preferences)

  8. Download .htaccess (thereby forcing it to be visible on the local side as well)
  9. Copy the index.php and .htaccess files from your blog root to the site root.
  10. Open index.php and change this line:
    require('./wp-blog-header.php');

    to read:

    require('./yourblog/wp-blog-header.php');
  11. You should now be able to navigate to your site root http://yourock.com, and see your blog content, rather than a static front page
  12. Note: (make sure you don’t have something like index.htm in your root, which would override index.php)

Update: The following portion of this tutorial is no longer necessary since the release of WP version 2.1, which added the ability to create a static page from within the Admin UI.

Step II: Create a Static Index Page

Done? Right on. Now that you’ve got WP installed, it’s time to configure it as a CMS. First, a little clarification:

Standard websites use a home page to serve as an introduction to visitors… “Here’s who we are, here’s what we do.” On a blog site, there’s typically no static page but rather a database generated page showing the latest post or whatever. The content changes every time there’s new activity.

Because you want to use Wordpress to manage all your content, you may also want to set up a static landing page where you can have more precise control over the elements that appear there. In other words, you may not want your latest blog entry to appear when someone enters your URL.

Your static page can be set up as a hybrid, in which specific portions of the content are dynamically generated and the rest is manually updated, or if you’re really picky you can have it be completely static. Either way, you can customize it to display whatever information you want. Here’s how to accomplish that:

  1. Create your own index page duplicating the index.php page residing within your theme folder, and rename it home.php
  2. Move home.php to your root directory. This will now serve as your new “index” page, or static home page. Make any modifications you need to the design to accommodate your content.
  3. Open .htaccess from your root folder. Above the existing lines of text insert this:
    DirectoryIndex home.php index.php
  4. Save and upload.

Note: You must still list index.php as a second choice or you won’t be able to access index.php in any of your subdirectories unless you specifically list the URL. For instance, http://yourock.com/wp-admin/ won’t work.

Step III: Tie It All Together

To integrate WordPress with your static landing page, you can call the header, sidebar and footer as includes, carrying out a consistent theme across all pages of your site. To include the header, add the following to the top of the page:

<?php define('WP_USE_THEMES', false); require('./yourblog/wp-blog-header.php'); get_header(); ?>

To use the sidebar and/or footer, it’s a bit simpler, just add the following at the bottom of your page:

<?php get_sidebar(); ?>

and/or

<?php get_footer(); ?>

You can also use The Loop to display dynamic content, as mentioned earlier. Want to add a list of recent blog posts to your home page? No prob. Use a scaled down version of The Loop as a feeding mechanism to call any posts from the database associated with the category you want to display. Conversely, you can code your home page to retrieve the permalink for each article. Refer to the Wordpress official Codex to find snippets of code and make the job a snap. Then use CSS to style the results any way you like!


  1. Use Wordpress As a CMS | Design Adaptations

    [...] you followed along with the second post of this series, you’ve no doubt got your shiny new Wordpress installation set up and ready to customize as a [...]


  2. want to believe

    “stumbling through various articles which briefly touch on using Wordpress as a CMS but don’t actually explain how to set it up that way” - indeed, so many articles, so little information, and in fact so little understanding of what a CMS even is.

    while this has some nice details for setting up wordpress, that doesn’t make it a CMS in anything but the most rudimentary sense. if a single user is using the system, this might work. but if more than one is … how about versioning to keep track of what’s changed. (there’s a plugin, but it’s a key feature with little development activity.)

    and for a site with several users, a publishing / approval workflow system is needed to make it a CMS.

    and so on.


  3. Charity

    All good points, and something anyone setting up a community portal should consider when looking at Wordpress vs. a full-blown CMS. This article focuses mainly on the blogger who wishes to manage his/her entire site with WP as opposed to just a blog.

    I can’t say with any certainty that Wordpress would fall short, because I have not had any experience running a portal type site. However I think WP has made a log of strides in its ability to manage something like that.


  4. links for 2007-09-10 | SOJo: Student of Online Journalism

    [...] Configure Wordpress As A CMS (tags: blogs cms wordpress) [...]


  5. bhagerty

    I’m pretty sure this instructions don’t work as written. In particular, in step II item 1, you instruct users to copy “index.php” from the theme directory to “home.php”, which should then be placed in the root directory.
    Let’s assume you do that, and that you edit .htaccess successfully so that the URL “mysite.com/” delivers “mysite.com/home.php”.
    That is going to give an error message, because “home.php” calls functions: specifically, you’ll get the error message “Call to undefined function get_header()”.
    Now, if you skip this step (of copying “index.php” from the theme directory to “home.php” in root) and instead go straight to your step III and edit “home.php” so that it begins with the code there (which happens to be the code in index.php that was originally found in the WORDPRESS directory, NOT in the theme directory), then it will work.
    But in that case, why bother with copying “index.php” out of the theme directory at all? Why not use “index.php” that’s already in root?
    I appreciate the effort you’ve put in to these instructions, but you might want to consider rewriting them.


  6. Charity

    @ bhagerty - this post was aimed mostly at WP2.0. With 2.1, we were given the ability to add a static home page right from within the admin panel. Needless to say, the portion of the tutorial on creating a static page has become outdated, as you can see here.

    Thank you for bringing it to my attention. I’ve added a notice above that section to let readers know.


  7. WPMU and WP as CMS « Feet up, eyes closed, head back

    [...] DesignAdaptations, Using WP as CMS and “Configure WordPress as a CMS“; see also “Potential of WP; Extending as a [...]

Other Recent Articles

In Design »

The Evolution of a Logo (I Can Live With)

06/19/08
One of the most frustrating things for me since I started writing on this blog was the lack of a logo I really loved. That's not to say I haven't tried. But logo design, to me, is kind of a thing all it's own and I'm just not very good ... [ » ]

In Freelancing »

Family and Freelancing - The Ultimate Balancing Act

05/29/08
A couple weeks back FreelanceSwitch had an excellent article on how so many freelancers tend to disrespect their own time. It was an article I seriously needed to read, because I'm one of them. It's often not by choice, however. Due to parental demands or household responsibilities which must be ... [ » ]

In Productivity »

15 Apps/Services I’d Actually Pay For

05/17/08
Have you ever stopped to consider how heavily you rely on free or open source services? There are a number I use daily that improve/simplify my life or business, but until I saw Mark Ghosh's list of 15 websites or services he'd actually pay for (spurred by Ryan Spoon's post ... [ » ]