Localized WordPress content for different sub-locales of same language?

I have a site which serves Ireland England. I want to move it to Wordpress.

Currently all the content is the same when you visit the site it runs off two urls, the Irish one: mysite.ie the english mysite.co.uk

I need to show different prices based on whether the user is visiting the Irish site or the English one. Currently I do something like:

$host = $_SERVER['HTTP_HOST']; 
if($host == "www.mysite.ie") {
 //show Irish prices
}

I don't think I can run one WP installation off 2 domains for a start.

It's not multilingual, so is there a way to show all the same content except for small differences based on the URL?

Topic l10n localization urls multisite Wordpress

Category Web


Well, actually, you should view your site as requiring "multilingual" capabilities, even if the base language for both countries is identical, because the actual locale for each is nevertheless different.

More specifically, you can create variant "translations" for your British ('en_GB') and Irish ('en_IE') localizations. A plugin such WPML (WordPress Multilingual) can help you implement this, and it supports different URL schemes for differentiating between the localizations, including:

  • different domains (or subdomains)
  • different subdirectories

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.