I’ll try to explain how it might be done, but not sure it will work:
-
Install 2nd website with single db (2 copies).
-
Create new table in your db. Call it
wp_options2
and copy everything fromwp_options
into the new table -
in second install in
wp-config.php
, beforeif ( !defined('ABSPATH') )
adddefine( 'M7_OPTIONS_TABLE', 'wp_options2' );
-
in second install go to
wp-includes/wp-db.php
on line 1054(for WP 5.6) and add this code:if ( isset( $tables['options'] ) && defined( 'M7_OPTIONS_TABLE' ) ) $tables['options'] = M7_OPTIONS_TABLE;
(This code should be added to the
public function tables
function, beforeif ( isset( $tables['users'] ) && defined( 'CUSTOM_USER_TABLE' ) )
)
Now you should be able to change the theme, plugins atc. for the second theme, but all posts, taxonomies etc. will be doubled in both websites (wich is bad for seo btw.)
Should you run into problems with links on your second install, add:
define('WP_HOME','http://seccond_website.com');
define('WP_SITEURL','http://seccond_website.com');
in your wp-config.php
file …..
but it wouldn’t solve the problem if you were to create some post on the 1-st website, on the second website it would link to the first website…
I’ll still post this answer, even though it’s not correct (because of the problem described above).
As a solution you could create 2 separate installs with different $table_prefix
and add an action to each move (save_post, save_taxonomies, save_postmeta etc.) to save from 1 db to the other, but changing the necessary links.
Or you could create a cron job on the second install to parse every post, page etc from the 1-st db to the 2-nd (since you have the access to both of them, it would be easy)