Hàm bảo trì website mà không cần dùng plugins
[php]
function wp_maintenance_mode(){
if(!current_user_can(‘edit_themes’) || !is_user_logged_in()){
wp_die(‘
Vui lòng kích hoạt bản quyền code trang web này
Liên hệ chúng tôi để được trợ giúp!’);
}
}
add_action(‘get_header’, ‘wp_maintenance_mode’);
[/php]