WordPress: How can I create two blogs sharing the same database?

I’ve built a WordPress website at e.g. domain.com and I’m wanting to build a Web App at e.g. chrome.domain.com which will contain a second installation of WordPress but the site will be exactly the same in terms of content (except for the URLs) and have a different theme.

Is it possible to do this? Any suggestions on how I could do this? Perhaps somehow running a different theme for the app on the main website? As I’m also looking to make the site work on both the iPhone and iPad again with Themes for each so as to make it all look native.

Read More

Thoughts on this would be much appreciated. Thanks.

Related posts

Leave a Reply

3 comments

  1. I would suggest you to make use of WPMU, which now is Network in the latest wordpress release.
    What this does is to allow you to use a single install of wordpress as one or more wordpress blogs. You can then just use a theme and tell wordpress to display what is on main wordpress blog on this blog.

    Using the above strategy, will make you utilize a single database for all your wordpress blogs (called as network blogs) and also help in making them talk to each other (e.g. here you want the chrome.domain.com blog to display posts from domain.com blog)

    A more detailed information can be found at: Create a Network

    To display posts from main blog (which is generally id= 1), use a function like:
    (the below function is just an example) in your chrom.domain.com theme’s template file

    function get_recent_blogposts_wpmu($blog_id,$show){
     wp_reset_query();
     switch_to_blog($blog_id);
     global $post;?>
     <?php $my_query = new WP_Query('showposts='.$show.'&order=DSC');
     while ($my_query->have_posts()) : $my_query->the_post();
         $do_not_duplicate = $post->ID; ?>
         <li class="post_link"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a> </li>
            <div style="float:left;margin:5px 0 0 10px;">
            <?php the_content(); ?>
            </div>
     <?php endwhile; ?>
     <?php restore_current_blog();
    }