Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How do you run two Wordpress blogs with different themes using one database where the content remains the same in both sites? The issue that I am getting is at the Domain mapping in both blogs.

share|improve this question
    
If you have multisite installed as per your question tag? then this should work just like what your asking. If multisite is not working can you be clearer on the issue and provide an example? –  Shawn Jan 9 '14 at 20:44

4 Answers 4

Not sure if it will be enough but this two plugins should give you most of what you want Any hostname - change the content urls to reflect the domain in which the content was requested Domain Theme - change the them according to the domain name.

I haven't tested any of them but it looks like even if they don't work you can get useful pieces of code from them.

share|improve this answer

If you have two separate WordPress installations (one per domain), you can define WP_SITEURL and WP_HOME in wp-config.php to force a specific address/hostname. Add this code to each wp-config.php:

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

And change example.com to the name of the domain in question.

share|improve this answer

I'll try to explain how it might be done, but not shore it will work:

  1. Install 2 website with single db ( 2 copies ).
  2. Create new table in you'rs db. Call it wp_options2 and copy everithing from wp_options inside new table
  3. in seccond install in wp-config.php, before if ( !defined('ABSPATH') ) add define( 'M7_OPTIONS_TABLE', 'wp_options2' );
  4. in seccond install go to wp-includes/wp-db.php on line 951 and add code:

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' ) ) )

Now you should be able to change theme, plugins atc. for seccond theme, but all posts, taxonomies atc. will be dubbled in both websites ( wich is bad for 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 .....

but it wount solve the problem if you create some post in 1-st website, on seccond website it will link to first website..

I'll still post these asnwer, but it's not correct ( becouse of error described above ).

As a solution you could create 2 separet installs with different $table_prefix and add action to each move ( save_post, save_taxanomies, save_postmeta atc. ) to save from 1 db to enothere, but changing the necessery links..

or ypu could create a crone job on seccond install to pars every post, page atc from 1-st db to 2-nd ( as you have acces to them it would be easy )

share|improve this answer

Let me repeat your question in my words: you want two wordpress sites, using the same database and the same content. Just having a different theme and a different domain name?

That's duplicate content an google will rank both your sites badly for doing so.

I highly encourage you not to do so.

If you just want to share parts. Have a look at the switch_to_blog() function provided by WordPress multisite.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.