2020-07-14

WordPress Maintenance Mode Script

 14 Jul 2020  Snippets

WordPress Maintenance Mode Script

Add the following to current theme’s functions.php before the closing PHP tag:

/*
  Place the code below at the end of the theme's 'functions.php' file
*/

// Activate WordPress Maintenance Mode
function wp_maintenance_mode() {
if (!current_user_can('edit_themes') || !is_user_logged_in()) {
wp_die('<h1>Website Under Construction</h1><br/>Please check back later.');
}
}
add_action('get_header', 'wp_maintenance_mode');
Webmentions & Comments

Copyright © Paramdeo Singh. Built with Jekyll and ☕️ in Guyana. All Rights Reserved.

Last Site Build on Thu, 21 Oct 2021 17:49:44 -0400

1MB Club Badge

Paramdeo Singh Guyana

Riding the wave of consciousness in this treacherous mortal sea.

Technology Design Strategy Literature Personal Blogs