<\/span><\/h4>\nTo add a code snippet to enable maintenance mode on your WordPress site, you need to add the code to your theme’s functions.php file. After you have opened the file, add the code mentioned below:<\/p>\n
add_action(“wp_head”,”maintenance_mode”);
\nfunction maintenance_mode()
\n{
\nif(!current_user_can(‘edit_themes’) || !is_user_logged_in())
\n{
\nwp_die(‘Under Maintenance<\/strong>
Our website is undergoing scheduled maintenance,
We should be back shortly. Thank you for your patience.’);
\n}<\/p>\nRemember to replace the message with your text.<\/p>\n
<\/span>Step 2: Save the Changes<\/span><\/h4>\nAfter updating the code, save the functions.php file. Visit the website to see the effects.<\/p>\n
<\/span> Method 3: Setting up the construction page using a custom page template <\/span><\/h3>\nYou can create a custom page template for configuring an under-construction model without installing any plugin or manually coding. This approach, however, requires a little bit of coding knowledge.<\/p>\n
<\/span>Step 1: Create a Custom Page Template <\/span><\/h4>\n To configure an under-construction page on your WordPress site, create a new template file in your theme directory named “under-construction.php”. Add some basic HTML tags such as header and footer, and your custom message. <\/p>\n
<\/span>Step 2: Set Your Custom Page As the Front-Page <\/span><\/h4>\nOnce you’ve created the custom page, set it as the front-page of your WordPress site. To do that, go to Settings > Readings > Front Page. <\/p>\n
<\/span>Step 3: Save the Changes <\/span><\/h4>\nOnce you’ve set the custom page as the front-page, save the changes and visit the website to see how it looks. <\/p>\n
<\/span>Conclusion <\/span><\/h2>\nIf you’re redesigning or updating your website in WordPress, maintaining an under-construction mode is a useful tool. Enabling maintenance mode on your WordPress site is easy via plugins, code snippets, or the creation of a custom page template. By following the instructions above, you can easily maintain your WordPress site and prepare it for launch. Select a method that fits your needs and coding abilities and take your website down in just a few clicks. <\/p>\n","protected":false},"excerpt":{"rendered":"
Are You Perplexed On How To Put Your WordPress Site Under Construction? WordPress is an intuitive and powerful Content Management System (CMS) that contains a…<\/p>\n","protected":false},"author":1,"featured_media":7209,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3287],"tags":[],"jetpack_featured_media_url":"https:\/\/mauricemuteti.info\/wp-content\/uploads\/2023\/03\/WORDPRESS-ULTIMATE-GUIDE-How-To-step-by-step-Tutorial.png","_links":{"self":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/posts\/8352"}],"collection":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/comments?post=8352"}],"version-history":[{"count":0,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/posts\/8352\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/media\/7209"}],"wp:attachment":[{"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/media?parent=8352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/categories?post=8352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mauricemuteti.info\/wp-json\/wp\/v2\/tags?post=8352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}