2020-07-14

WordPress Maintenance Mode Script

 14 Jul 2020  Meta Code

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 Tue, 13 Apr 2021 16:55:04 -0400

1MB Club Badge