0

我有多个域,例如:www.site1.com、www.site2.com、www.site3.com

我希望他们都共享相同的数据库表,除了 WP_OPTIONS 表。这是因为每个站点都将充当“独立”实体,但仍将具有相同的页面、帖子、产品等......

我怎样才能做到这一点?

4

2 回答 2

1

我真的不明白你为什么需要这种功能,这将是 baaaad 的 SEO :)

但是,有几个插件可以让您将帖子传播到 Wordpress 网络安装中。

DiamondMultisite允许您在 wordpress 多站点安装中的所有博客中发布帖子,我猜它适用于页面

还有ThreeWP Broadcast支持更多的内容,似乎也更活跃。

于 2013-05-21T09:27:20.590 回答
0

您可以在每次安装中配置使用的数据库表名称:http ://wordpress.org/support/topic/share-certain-parts-of-a-wp-database-over-2-domains

引用链接网站:

Edit the wp-db.php file in the wp-includes directory.
In the function set_prefix($prefix) section

After :

foreach ( $this->tables as $table )
$this->$table = $this->prefix . $table;

Added :
$this->options = 'wp_' . 'options';

更多表格:

$this->posts = 'wp_' . 'posts';
$this->categories = 'wp_' . 'categories';
$this->options = 'wp2_' . 'options';
$this->links = 'wp2_' . 'links';
$this->postmeta = 'wp_' . 'postmeta';
$this->terms = 'wp_' . 'terms';
$this->term_taxonomy = 'wp_' . 'term_taxonomy';
$this->term_relationships = 'wp_' . 'term_relationships';

缺点:在 WordPress 更新期间,该文件很容易被覆盖。

附加说明:我同意 x4vier 的观点,即 SEO 结果会很糟糕。我不会推荐整个概念。

于 2013-05-21T09:38:01.527 回答