Hi
Can anyone think of an idea or way where i park say 50 domains on a wordpress site i can show a different sidebar to what domain name is in the URL?
thanks in advance
paul
hi alex
i have just added them in cpanel and parked them on the main domain.
If all you're wanting to change is the sidebar content then multi-site approach is a bit of overkill.
WP is pretty good at grabbing query vars, though you'd have to register a new one for 'd'. You can then do what you want with it. Using a registered taxonomy and grabbing the term would bypass that, and you'd be easily able to permalink it.
It'd be much easier to advise on the best solution for doing this if we knew what the sidebar contained and how much it differed site to site.
Might be better to do it by category then.
Post Type: Domain
Taxonomy: Category
Add domain to post type, assign to category. Use woosidebars to generate a 'category' sidebar per category and assign to category term and override the default sidebar. 10+ category sidebars with their own widgets e.g text widgets with products. Should work.
There are a load of $10 scripts that allow one Wordpress install to show the parked domains and in the url bar. Don't you just then have some html in the sidebar which displays your products based upon the url?
If host equals etc your keyword. A couple of lines could work for dozens of domains and different keywords products etc
Or is that too easy?
Probably a better question for Paul, but am I missing something?
Let's say he has example.com, example.org and example.co.uk. If he wants people to go to either of these domains and the page rendered is the homepage for that domain, ie that domain is exactly what is in the address bar, then how can this be done with 1 WordPress install? A single WP install can only work with a single domain. Changing the domain breaks the WP structure.
I hope I'm wrong mind, because this would seriously help us with a project we're working on at the minute
But what you suggest tifosi, in my mind, only works if the original domain forwards to a single central domain with the WP install. Now this could be what Paul wants and I've misunderstood, but my impression was that the domain wouldn't forward, it would instead render the instance of WP as its own site defined by the fact the domain doesn't change in any way.
I can only see this working as either some parameter or sub directory that defines the domain following a redirect, or by multisite where one WP install allows multiple domains to render on a single install.
function check_input($data)
{
$data = htmlspecialchars($data);
return $data;
}
//Get Page URL
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return check_input($pageURL);
}
$url = curPageURL();
$url = str_replace('http://www.','', $url);
$url = str_replace('/','', $url);
We use essential cookies to make this site work, and optional cookies to enhance your experience.