Putting two themes together to create a complete site

Think Twice

I have to start by saying that this seems like a really odd idea. Having a front page that’s totally different from the rest of the site will break a lot of user expectations and cause confusion. Is it really two completely different themes or do you just want a custom layout on the front page? If the latter, a custom implementation honestly might be simpler. This is particularly the case if there are advanced theme options or metaboxes used to maintain the front page. I’m going to stick only to front-end issues here as that’s really the only thing I can safely make assumptions about. But let’s assume it’s not.

Copy all the necessary templates

I’d use the non-home theme as the main theme and integrate the front into there. So, from the “front page theme” determine which files you need to include. If there’s a front-page.php (assuming you’re using a static front page), you’ll copy that. (Save the old front page with a new name if there was one.) In the new front-page.php file, look for anything included with include(), require(), get_template_part(), get_sidebar(), get_footer() etc. From the front page theme, copy all of those files into your new theme. For all of these files, include a suffix (e.g. sidebar-front.php, header-front.php). Finally in your copied front-page.php change functions to use the suffixed version (e.g. get_sidebar( 'front' ))

Conditionally Load Scripts & Styles

Now, in your main theme’s functions.php file, you’ll load the scripts and styles you’ll need onto the correct pages. Copy any scripts and stylesheets you know are used on the front page theme. Again, suffix theme to make sure there’s no overlap.

Now, add conditional wp_enqueue_scripts() and wp_enqueue_styles() calls to load your stylesheets. If either header.php is linking the stylesheets, delete those lines. Your code will look something like this:

function wpse_58889() {
    if( is_front_page() ) {
        wp_enqueue_style( 'style_front', get_template_directory_uri() . 'style-front.css' );
    } else {
        wp_enqueue_style( 'style_front', get_template_directory_uri() . 'style.css' );
        wp_enqueue_script( ...... );
    }
}
add_action( 'wp_enqueue_scripts', 'wpse_58889' );

This step will involve moving any existing styles and scripts enqueued in the main theme’s functions.php into those conditionals so they don’t conflict with other styles on the new front page.

Theme Functionality

As I said, I’m not even going to guess on what’s required for this. You’ll have to do a lot of poking around and copy over any register_sidebar() calls relevant to the front page along with theme options and metabox stuff. At this point in the process you may run into a LOT of file-dependencies and you may end up integrating half the old theme into the new one. The whole time, you’ll have to continue watching out for naming conflicts in files, functions, and more!

Conclusion

In the simplest cases, this process won’t be too hard, but if you’re new to PHP and WordPress Theming (more the latter than the former, imho), this could get really nasty really fast. Even though a lot of these changes are straight-forward in the abstract, there are a lot of places where a small oversight could really make things haywire for a while.

Good luck.