简体   繁体   English

在2个不同的wordpress网站(不同的URL)之间共享相同的帖子和页面数据

[英]Share same post and page data between 2 different wordpress site(different url)

我已经制作了3个房地产演示网站(具有不同的设计和布局),但是由于网站托管服务器单一,我希望使用相同的数据库运行所有2个演示。

I am not confirm but hope this will work for you. 我不确定,但希望这对您有用。

Install 2 website with single db ( 2 copies ). 使用单个数据库(2个副本)安装2个网站。 Create new table in you'rs db. 在您的数据库中创建新表。 Call it wp_options2 and copy everithing from wp_options inside new table in seccond install in wp-config.php , before if ( !defined('ABSPATH') ) add define( 'M7_OPTIONS_TABLE', 'wp_options2' ); 将其命名为wp_options2,并在wp-config.php中的 seccond install中的新表中复制wp_options的所有内容 ,然后再添加if ( !defined('ABSPATH') ) add define( 'M7_OPTIONS_TABLE', 'wp_options2' ); in seccond install go to wp-includes/wp-db.php on line 951 and add code: 在第二次安装中,转到第951行的wp-includes / wp-db.php并添加代码:

if ( isset( $tables['options'] ) && defined( 'M7_OPTIONS_TABLE' ) )
                $tables['options'] = M7_OPTIONS_TABLE;

( these code should be added in public function tables function, before if ( isset( $tables['users'] ) && defined( 'CUSTOM_USER_TABLE' ) ) ) (这些代码应在if ( isset( $tables['users'] ) && defined( 'CUSTOM_USER_TABLE' ) ) )之前添加到公共函数表函数中if ( isset( $tables['users'] ) && defined( 'CUSTOM_USER_TABLE' ) ) )

Now you should be able to change theme, plugins atc. 现在您应该可以更改主题,即atc插件。 for seccond theme, but all posts, taxonomies atc. 对于第二个主题,但所有帖子,分类法atc。 will be dubbled in both websites ( wich is bad for seo bdw. ) 将在两个网站上出现问题(这对seo bdw不利。)

if on seccond install you'll have some problems with links, add 如果在第二次安装时您会遇到一些链接问题,请添加

define('WP_HOME','http://seccond_website.com');
define('WP_SITEURL','http://seccond_website.com');

in your wp-config.php file ..... 在您的wp-config.php文件中.....

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM