defining theme for multiple domains in wp-config.php
-
I’m creating a mobile version of my latest project the hard way.
Basically, instead of doing detection and using a different style sheet, I want to allow increasingly-capable mobile users to view the site in its full glory by visiting the regular .com domain. Those who want to access the mobile version will do so via the .mobi domain of the same name.
That way, the choice is theirs… and besides, the .mobi visitors will have almost certainly spent a large amount of time on the regular site first, so I’m not expecting any first-time mobile visitors.
Before you jump in with the duplicate content deal, I want to point out that there’s a robots.txt blocking indexing of the .mobi domain so that google remains a happy chappy.
Anyway, I’m doing the multiple domain bizzo using the following code in wp-config.php
$domain = $_SERVER['SERVER_NAME']; $domain = str_replace('www.', '', $domain); if ($domain == 'sitename.mobi') { define('WP_SITEURL', 'https://sitename.mobi'); define('WP_HOME', 'https://sitename.mobi'); }
Now, I’d like to redefine the theme in use, so I can make a much lighter theme for the mobi domain, rather than just changing the style sheet.
I tried to define the TEMPLATEPATH constant right there, but that resulted in wordpress trying to load the theme twice… once for the regular version, and once for the newly defined constant.
Is there a way I can trick wordpress into re-defining the theme here in wp-config.php?… or perhaps somewhere where I can keep track of it just as easily, like index.php?
I looked up the list of constants but as the two I’m actually using above are not listed there, I have little confidence in the list.
Can anyone suggest an alternative to try?
Thanks a bunch.
- The topic ‘defining theme for multiple domains in wp-config.php’ is closed to new replies.