If your WordPress-powered website is currently under construction and you may not want others to be able to see your site until it’s complete.
You can use a plugin to do this, but it’s pretty simple to include this functionality within your theme. Add the following code in the functions.php of the theme:
[code] function maintenance() {if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {
wp_die('<h1>Maintenance Work<h1> Coming Soon. We are working hard.',
'Here we are working');
}}
add_action('get_header', 'maintenance');
[/code]This function turns on a holding page for all non-admin users that visit your website.