set website in maintenance mode

// Set website in maintenance mode. function maintenace_mode() { if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {wp_die('Maintenance.');} } add_action('get_header', 'maintenace_mode');
To de-activate maintenance mode, simply comment out the add_action line. And no, it’s not a typo.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.