[WordPress] 外掛分享: MultiDomain

首頁外掛目錄 › MultiDomain
300+
安裝啟用
★★★★
4.3/5 分(6 則評價)
5241 天前
最後更新
問題解決
WordPress 3.0+ v1.0 上架:2011-10-27

內容簡介

在單一 WordPress 安裝中指向多個網域/子網域,並保持鏈接一致性(例如,如果您在 http://foo.com 上,則鏈接將是 http://foo.com/bar,如果您在 http://baz.com 上,鏈接將是 http://baz.com/bar)
根據網域覆寫網站標題,描述或佈景主題
使用 [MultiDomain_if] 和 [MultiDomain_else] 簡碼自訂每個網域的內容

如果您需要更多網域之間的自定義,WordPress MU 是更好的選擇。

配置示例

請注意,您通常不需要配置您的主要網域 – 如果不存在網域的配置,MultiDomain 將自動返回您的 WordPress 默認值。

基本

在 config.php 中:

<?php
$domains = array(
array(
'domain' => 'myalternatedomain.com',
'siteurl' => 'http://myalternatedomain.com',
'home' => 'http://myalternatedomain.com'
)
);
?>

較複雜

在 config.php 中:

<?php
$domains = array(
array(
'domain' => 'example1.com',
'siteurl' => 'http://example1.com',
'home' => 'http://example1.com'
),
array(
'domain' => 'example2.com',
'siteurl' => 'http://example2.com',
'home' => 'http://example2.com',
'blogname' => 'Example 2'
),
array(
'domain' => 'example3.com',
'siteurl' => 'http://example3.com',
'home' => 'http://example3.com',
'template' => 'twentyten',
'blogname' => 'I have a different name...',
'blogdescription' => '..and description'
)
);
?>
標記用法

提供的簡碼讓您根據需要定制每個網域的內容。 [MultiDomain_if] 和 [MultiDomain_default] 是相同的。

[MultiDomain_if domain="example1.com"]
只有在 example1.com 上訪問的人才會看到的內容。
[/MultiDomain_if]

[MultiDomain_else]
任何其他域名的訪問者都會看到的內容
[/MultiDomain_else]

每個人都會看到的正常內容。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「MultiDomain」→ 直接安裝(推薦)

原文外掛簡介

Point multiple domains/sub-domains at a single WordPress installation and maintain link integrity (i.e. if you’re on http://foo.com, links will be http://foo.com/bar, and if you’re http://baz.com links will be http://baz.com/bar)
Overwrite site title, description, or theme per domain
Customize content per domain using the [MultiDomain_if] and [MultiDomain_else] shortcodes

If you need more customization between domains, WordPress MU is a better option.
Configuration Examples
Note that you usually won’t need to configure your primary domain — MultiDomain will automatically fall back to your WordPress defaults if not configuration is present for a domain.
Basic
In config.php:
'myalternatedomain.com',
'siteurl' => 'http://myalternatedomain.com',
'home' => 'http://myalternatedomain.com'
)
);
?>

More Complex
In config.php:
'example1.com',
'siteurl' => 'http://example1.com',
'home' => 'http://example1.com'
),
array(
'domain' => 'example2.com',
'siteurl' => 'http://example2.com',
'home' => 'http://example2.com',
'blogname' => 'Example 2'
),
array(
'domain' => 'example3.com',
'siteurl' => 'http://example3.com',
'home' => 'http://example3.com',
'template' => 'twentyten',
'blogname' => 'I have a different name...',
'blogdescription' => '..and description'
)
);
?>

Tag Usage

The provided short codes let you tailor your content per domain if needed. [MultiDomain_else] and [MultiDomain_default] are identical.
[MultiDomain_if domain="example1.com"]
Content only people visiting on example1.com will see.
[/MultiDomain_if]

[MultiDomain_else]
Content anyone visiting on any other domain will see.
[/MultiDomain_else]

Normal content everyone will see.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon