Maintenance mode

If you are making some live changes(like updating source code and design) on your blog, you might want to enter a maintenance mode to keep the users from disturbing you.

What you can do is to use some conditional tags to shut down the website for everybody without admin permissions. You as a admin will still have full access to both the blog and to the admin panel.

Add this code to your functions.php.

Code Snippet:

<?php
function maintenace_mode() {
  if ( !current_user_can( 'administrator' ) ) {
    wp_die('Maintenance.');
  }
}
add_action('get_header', 'maintenace_mode');
?>

Posted in Pure hacks