One WordPress Install, Multiple Subdomains

Hey guys, it’s come a time where I finally need to get into using a CMS as a particular project has just grown too large!

I have a static website that is getting some friends… 19 to be precise! Essentially I’m going from one website, who we’ll call http://www.jiggins.abc, that will turn into 20 different local sites (vancouver.jiggins.abc, victoria.jiggns.abc, calgary.jiggins.abc, etc etc).

Each site will essentially have the same layout, the only difference will be the logos and the ads. They will all have the same navigation, the only difference being the "Events" and "Local" sections for each site will be different (they will contain different information depending on which regional website you are in).

So, my question! Can all of this be achieved with one install of WP. For example, if I have to change something in the Health section, I want to edit one page in WP and have it be reflected across all 20 sites.

I don’t think I need anything more powerful than WP, it’s not an overly complicated site. Any input would be greatly appreciated!

I would DEFINITELY suggest using WordPress MU. It even comes with the feature of using subdomains and it is pretty easy to set up if you know what your doing. Unfortunately there’s not alot of helpful documentation. But I find i pretty self explanatory.

In regards to changing each page at the same time (eg. Health) You could knock up a php script to do it, and if your really eager you could release it as a WordPress MU plugin, if there isn’t one already.

In regards to changing each page at the same time (eg. Health) You could knock up a php script to do it, and if your really eager you could release it as a WordPress MU plugin, if there isn’t one already.

Would I simply be able to add some simple PHP dealy like:

Code:

< ?php //pretend this is real code im_a_wp_tag_that_gets_info_for_health_page { and I work } ?>

yep, so the code in my previous post should work for that. The $n is the unique blog number. Each site can have it’s own theme and permissions can be controlled by the site administrator, so Vancouver cannot edit Toronto. It’s just a matter of putting the code in a template for the Health page and set the blog id number to the appropriate Unique number for "Canada – Health"

On a separate note, why is CMS the way to go? Why not hard code php? Such as

In the events part ( and local, and where parts need to be different per location, eg ads.)
<?php
if( $_SERVER == ‘vancouver.jiggins.abc’) {
include ‘vancouver_events.php';
} elseif( $_SERVER == ‘toronto.jiggins.abc’) {
include ‘toronto_events.php';
} etc…
?>

I would recommend making your own custom system. This way you have full control and unerstanding

I’ve thought about it, but I eventually want to hand this over. It’s currently just one site, which I handle myself and I implement includes right now.

Due to the fact that I want to hand it over (and/or may have a person in each city take care of their own sites and have just 1 main admin), it needs to be easy/simple with little to no code knowledge.

Tips

What now? I have some ideas for you.

Go explore CodePen!

As a front end designer and developer, you should have an account on CodePen so you can save your snippets, present your ideas, and engage with other front end folk. I'd encourage you to go PRO as well, to unlock the full power of CodePen.

Get the newsletter!

You should sign up for the CSS-Tricks newsletter. It's a clean copy of all the blog posts each week, combined together, right to your inbox. If email isn't your thing, there is an RSS feed, iTunes, and lots of other ways to subscribe.

Listen to ShopTalk!

Subscribe to The Lodge!

The Lodge is a members-only, ad-free video learning area here on CSS-Tricks. Just like the free screencasts, but organized into four large complete series. Membership is also the #1 best way to support CSS-Tricks.

We can do the real footer now.

Site Links

Colophon

CSS-Tricks* is created, written by, and maintained by Chris Coyier. It is built on WordPress, hosted by Media Temple, and the assets are served by MaxCDN. The fonts are Source Sans and Source Code Pro. It is made possible by viewers like you who subscribe to The Lodge and through advertising for products and services I like.