I’ve been setting up a series of sites lately and wanted to use a single WordPress install for all the subsites. I was beating my head against a wall trying to figure out how I could have a single primary site and any blog’s made in specific categories would show up in these other sites.
I have FINALLY figured it out and I wanted to share it with the world.
*NOTE* Yes, I know about the duplicate content implications. If you don’t know about this, take a minute to read this: LINK1 or LINK2
Now, that we have that covered …. Let’s discuss what and how to do it. Let’s say you have 5 domains:
domain1.com
domain2.com
domain3.com
domain4.com
domain5.com
You want to have ONE installation of wordpress, ONE database with only one set of tables, and MULTIPLE domains pointing to different categories.
1. Download WordPress of course ![]()
2. Download Domain Mirror 1.1
3. Install it, but unzipping it and uploading to plugins folder. Active it in plugins section.
4. Install your favorite WordPress theme.
5. Here comes the tricky part. Thanks to this wonderful person, I ran across this.
- Open the index.php of your chosen theme
- Add at the top:
if (strstr($_SERVER['HTTP_HOST'], “YOUR-DOMAIN-HERE“)) {
query_posts(“cat=4“); } - Change the YOUR-DOMAIN-HERE for whatever domain you want. Important: Leave off the HTTP://. For example: www.crimm.me only.
- Change the 4 to whatever the category number is for the category you want.
- Can’t figure out the category number? An easy way is to turn of Permalinks and click on the category on your home page and look at the URL.
6. Check it out by visiting your domains
I’ll post mine once I’m done with them. I hope that helps someone out there!!!