Maintenance mode just for WooCommerce shop pages [closed]

You can add this snippet below to your themes functions file to create the message you want displayed. (For all Woocommerce conditional options, visit their codex here: http://docs.woothemes.com/document/conditional-tags/)

add_filter ('the_content', 'royal_woocommerce_maintenance');
function royal_woocommerce_maintenance($content) {
   if( is_woocommerce() or is_shop() or is_product_category() or is_product() or is_cart() or is_checkout() or is_account_page() ) {
      $content.= '<div style="border:1px dotted #000; text-align:center; padding:10px;">';
      $content.= '<h4>We will be back soon</h4>';
      $content.= '<p>We are down for maintenance, please check back soon.</p>';
      $content.= '</div>';
   }
   return $content;
}

Then in your CSS file you can target the classes or ID you wish to hide so for example

.products, .product {
    display: none !important;
}

You could obviously streamline this a little and turn it into a cool little maintenance mode plugin for Woocommerce and customize the look, message, etc but this should be enough to get you close to what you after for now 🙂

UPDATE:

I created a plugin for this, WooCommerce Maintenance Mode.

I have created a few options for displaying content, using redirects, adjusting frequency of messages & redirects and setting an expiration for the maintenance mode to deactivate automatically.

I will be adding more features soon! You can find it under plugins on wordpress.org

Please rate it and if you have any ideas or suggestions, please pass them along to me so we I make it even better 🙂