Need a quick maintenance mode? Use this snippet. Just comment it out when you don’t want it switched on.

 
function maintenace_mode() { 
 
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) { 
die('Maintenance.'); 
} 
} 
add_action('get_header', 'maintenace_mode');