Most advice I see on redesigning a live site with Oxygen is to create a completely separate staging site, as you would typically.

However Oxygen is quite unique. With Oxygen installed, the plugin overides not only the previous theme, but the content as well.  This means you can recreate your entire site with your new design and content on the same pages with Oxygen.

The way to do this is to enable Oxygen only for yourself for development (you will see Oxygen frontend and backend when logged in) and all logged out users will see the current version of the site and Oxygen will be completely invisible to them. This is done by uploading a php file (shown below). Then when you are ready to go live, simply remove that php file so that everyone sees the new version.

Please note that the standard way of redesigning a site with a staging site may be more appropriate in certain situations, such as if you are changing the plugins or functionality of your site. You will need to consider which is the best approach based on what changes you will be making.

Here is how to do it:

  1. Create a folder in your wp-content folder called mu-plugins
  2. Then in your mu-plugins folder create a php file called enable-oxygen-logged-in.php with this code below:


<?php
add_filter( 'option_active_plugins', 'enable_oxygen_logged_in' );
function enable_oxygen_logged_in( $plugins ) {
    require (ABSPATH . WPINC . '/pluggable.php');
    if ( !is_user_logged_in() ) {
           $plugins_not_needed = array ('oxygen/functions.php');
            foreach ( $plugins_not_needed as $plugin ) {
                $key = array_search( $plugin, $plugins );
                if ( false !== $key ) {
                    unset( $plugins[ $key ] );
                }
            }
        }
        return $plugins;
    }
?>

 
Thats it!  Please leave a comment below on your thoughts on this and if it worked for you.
 

Share