Skip to content

Instantly share code, notes, and snippets.

@wildiney
Created June 28, 2011 14:46
Show Gist options
  • Save wildiney/1051288 to your computer and use it in GitHub Desktop.
Save wildiney/1051288 to your computer and use it in GitHub Desktop.
WordPress - Put your site in Maintenace mode
<?php
function maintenance_mode() {
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {
wp_die('Maintenance, please come back soon.');
}
}
add_action('get_header', 'maintenance_mode');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment