Configure Wordpress As A CMS
Apr 2nd, 07
After 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
- Create a folder in your file structure where you want to install Wordpress. Unpack and FTP all the files into that folder.
- Navigate to the new folder in your browser and follow the prompt for setting up your database and logging in
- 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
- Change the address currently in the box labeled Blog address (URI) to reflect your root - http://yourock.com
- Save your changes
- Still under Options, go to the Permalinks tab, and change the structure to whatever pretty links you want
- Download .htaccess (thereby forcing it to be visible on the local side as well)
- Copy the index.php and .htaccess files from your blog root to the site root.
- Open index.php and change this line:
require('./wp-blog-header.php');
to read:
require('./yourblog/wp-blog-header.php'); - 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
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)
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:
- Create your own index page duplicating the index.php page residing within your theme folder, and rename it home.php
- 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.
- Open .htaccess from your root folder. Above the existing lines of text insert this:
DirectoryIndex home.php index.php
- 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:
To use the sidebar and/or footer, it’s a bit simpler, just add the following at the bottom of your page:
and/or
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!


[...] 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 [...]
Apr 5, 07 | 3:10 pm“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.
Jul 16, 07 | 7:19 pmAll 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.
Jul 27, 07 | 2:14 pm[...] Configure Wordpress As A CMS (tags: blogs cms wordpress) [...]
Sep 10, 07 | 6:22 amI’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.
Sep 30, 07 | 5:05 pmLet’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.
@ 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.
Oct 1, 07 | 12:33 pm[...] DesignAdaptations, Using WP as CMS and “Configure WordPress as a CMS“; see also “Potential of WP; Extending as a [...]
Dec 17, 07 | 1:34 pm