How to Turn on Maintenance Mode in WordPress
<?php
// put this into functions.php
function maintenace_mode() {
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {
die('Maintenance.');
}
}
add_action('get_header', 'maintenace_mode');
?>