Two Wordpress sites using different themes in the same database

I want to run 2 wordpress sites, one.site.com and two.site.com from one database. Everything remains the same except for the topic.

  • one.site.com - Existing Site
  • two.site.com - use the one.site.com database, except for the topic

Can this be done?

Since topic data is stored in a table wp_options, is it possible for two.site.com to use it to display another topic? Tell me, duplicate this table and make it use.site.com?

I appreciate any help.

EDIT:

There are no plugins on both sites.

+4
source share
3 answers

The solution below did my job,

2 WordPress .

. wp_options2 wp_options

wp-config.php, if (!defined('ABSPATH')) define( 'M7_OPTIONS_TABLE', 'wp_options2');

wp-includes/wp-db.php 1009 :

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

public function tables if (isset( $tables['users']) && defined('CUSTOM_USER_TABLE')))

, https://wordpress.stackexchange.com/questions/84313/how-to-run-two-wordpress-blogs-with-different-themes-and-with-single-database-an#answer-175494

, . , ,

.single a[href$=".jpg"] {
    pointer-events: none;
    cursor: default;  
} 
+3

, , .

: siteurl home, . , php.

, .

EDIT:

- .

+3

, (https://codex.wordpress.org/Configuring_Wildcard_Subdomains).

It may be a bit hacked, but you will need to check the status of your subdomain (perhaps in wp-config.php?) And install the theme in the database ( http://www.inmotionhosting.com/support/edu/wordpress/change- theme-in-db ).

The only problem I could see with is that your functions.php functions can change WP functionality, so a parent theme with two child themes is probably a good idea ( <a2> ).

+1
source

Source: https://habr.com/ru/post/1606950/


All Articles