WordPress FAQ: How Do I Integrate WordPress Into a Non-Blog Site?


I have a site that is a non blog site and I want to add a WordPress blog and allow the rest of the site to benefit from feeds, users, etc from the blog itself. Is there any easy way to do this?

Absolutely, this is a simple process. I’ve had a number of people ask me how to do this over the past year and a half or so. Depending on what your ultimate goal is, there are three options. Choose your poison.

Option 1: Limited Integration

The first option is the easiest and requires no code modifications. In fact, it is as simple as uploading the blog to a separate directory (i.e. ~/wordpress) and following the normal routine of installation. The only difference is that your blog permalinks will look like this: http://www.example.com/wordpress/.

Following this method, you could then place permalinks into place on the non-blog site manually. This is beneficial if you don’t anticipate the need for a lot of dynamic blog content outside the blog.

Option 2: Permalink Integration

The next option you have requires a small code modification but will give you access to all of WordPress code and internal API for integration into the site. After uploading the blog to the non-root directory (i.e. ~/wordpress), simply copy the wordpress index.php file into the root directory of the site. Modify this code in the file to point to the correct code

require('./wp-blog-header.php');

becomes

require('./wordpress/wp-blog-header.php');

You can verify that this modification was successful by browsing to the new index.php. If there are no errors reported and the blog loads, then you’re good to go. Now just go and make appropriate modifications under the Options page of wp-admin. The blog address field should be appropriately updated.

Incidentally, if you have your own index.php page, you can add the code from the WordPress index.php file to the top of your own file. No harm, no foul.

Option 3: WordPress as a Content Management System

The final option you have could be a topic in itself: WordPress as a CMS. WordPress provides options that allow you to define custom templates for specific pages or allows you to define a specific post or page as the home page – from within WordPress!

Richard Sipe has a great write up on how to do this. If you would like to manage your entire site, both blog and non-blog, from within the easy to use interface that is the WordPress admin – this is your solution.