Jul 10, 2011

Wordpress Maintenance Mode

OK, so you want your site to be in maintenance mode, ok, no worries, just copy the following snippet to your functions.php file.

[php]

function wp_maintenance_state() { if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) { wp_die('This site is under maintenance. Please try later.'); } } add_action('get_header', 'wp_maintenance_state');

[/php]
Don't Forget to remove this code, once you want the site to be live.

No comments :

Post a Comment