WordPress and buddypress programming

How to Put Your WordPress Site in Maintenance Mode (With & Without a Plugin)

Viewing 0 reply threads
  • Author
    Posts
    • #3766
      michael mc
      Keymaster
      @michael

      You need to add the following code to your theme’s functions.php

      function maintenance_mode() {
       
      if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {wp_die('Maintenance.');}
       
      }
      add_action('get_header', 'maintenance_mode');
Viewing 0 reply threads
  • You must be logged in to reply to this topic.