Maintenance mode using function

function maintenace_mode() {

      if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {wp_die('Maintenance.');}

}
add_action('get_header', 'maintenace_mode');

Leave a Reply