I’ve had an interesting request from a client, and subsequently spent a couple of hours looking into it. The crux of it is exactly as the title of this post suggests: they have 3 separate sites with unique domains, but the subject material & content for all three is ostensibly the same.
They would like to be able to manage a single pool of content from a single, central location, and for those changes to be echoed across the 3 sites.
For example, there is an Order Details page with an email address to enquire about back-catalogue items and a list of links to purchase stuff from. The client wants to be able to change that email address from info@ to sales@ and switch out the iTunes link for an Amazon link – and then for those changes to be updated on the Order Details page of each one of the three sites.
I’ve taken a look at WPMU; I hadn’t used it before, but I just did a quick installation and have been reading up on it for the last hour or so, but I don’t think it’s what we’re after, as each subdomain’s content is ‘siloed’ (as you’d expect).
I’ve also looked into services like InfiniteWP, which looks great and suggest that this kind of feature is ‘in the works’ (for a price), but obviously in the meantime involves switching between active sites to update posts & pages one site at a time.
So, does anyone know if this kind of thing is technically feasible, or if the client is asking for the moon on a stick?
Update: Client has just thrown a spanner in the works by suggesting that a single news post could be posted to one, two, or all three sites. Which makes things… interesting (read: headachey).
This should be doable.
First step would be pointing each domain to the same document root/install of WordPress.
Next up, use
WP_HOME
andWP_SITEURL
inwp-config.php
that change based on$_SERVER['HTTP_HOST']
. Example:That should force your permalinks (at least the ones generated dynamically), enqueues, etc to work correctly.
From there, I would create a metabox in the admin with some checkboxes for available domains. Each available post type should have this.
On the front end, hook into
pre_get_posts
, look for the current domain as the meta key, change the query to only fetch posts for that domain.Quick example (untested, use with caution):
In short, it’s doable, but you’ll need to be in control of the entire WP installation.
Other things to consider:
meta_query
on every page add?This is a really interesting idea. Might be good plugin material!