• This plugin is great, however, I would like to make it work for taxonomies. For now, it only works for categories.

    Let’s say I have this taxonomy:

    http://www.mysite.com/location/country1 , and I want to make it

    http://country1.mysite.com/

    Some of the author’s code is:

    class subSubdomain{
    var $slug;
    var $field;
    function __construct() {
    $this->field =’category_name’;
    }

    function getSubdomain(){
    $url = getenv( ‘HTTP_HOST’ );
    $domain = explode( “.”, $url );
    $this->slug = $domain[0];
    return get_category_by_slug($this->slug);
    }

    function getRewriteRules(){
    $rules = array();
    $rules[“feed/(feed|rdf|rss|rss2|atom)/?$”] = “index.php?” . $this->field . “=” . $this->slug . “&feed=\$matches[1]”;
    $rules[“(feed|rdf|rss|rss2|atom)/?$”] = “index.php?” . $this->field . “=” . $this->slug . “&feed=\$matches[1]”;
    $rules[“page/?([0-9]{1,})/?$”] = “index.php?” . $this->field . “=” . $this->slug . “&paged=\$matches[1]”;
    $rules[“$”] = “index.php?” . $this->field . “=” . $this->slug;
    return $rules;
    }
    }

    The author said in his blog that you just have to replace something about “taxonomy slug”. Could someone please give me a hint? Any ideas are very welcome.

    http://wordpress.org/extend/plugins/subdomains/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Subdomains] Making it work for taxonomies’ is closed to new replies.