Làm việc với wp-config.php

  • Thread starter Thread starter AdminAdmin is verified member.
  • Start date Start date
Admin

AdminAdmin is verified member.

Well-Known Member
Staff member
Administrator
Làm việc với wp-config.php thông số cơ bản.
Database Name : Tên database (tuoitrevnbiz_1234)
Database Username : Tên user (tuoitrevnbiz_1234)
Database Password : Pass database (tuoitrevnbiz) ^^
Database Host : Hostname (Localhost)

Trường hợp host sử dụng cổng kết nối khác
localhost

define('DB_HOST', 'localhost:3307');
Hoặc:

define('DB_HOST', 'mysql.example.com:3307');

Database character set
Ép kiểu dữ liệu : define('DB_CHARSET', 'utf8');

[h=3]Database collation[/h]
define('DB_COLLATE', 'utf8_general_ci');[h=3].........................................[/h]
[h=3][/h][h=3]Chỉnh thời gian tự động lưu bài viết[/h]
define('AUTOSAVE_INTERVAL', 160 ); // 160s

[h=3]Post Revisions – bản nháp[/h]Tắt
define('WP_POST_REVISIONS', false ); Giới hạn

define('WP_POST_REVISIONS', 3); // 3 bản


[h=3]Set Cookie Domain[/h]
define('COOKIE_DOMAIN', 'domain'); // Set Cookie cho tuoitreit.vn





[h=3]Enable Multisite / Network Ability[/h]Cho phép nhiều blog chung 1 data
define('WP_ALLOW_MULTISITE', true);


[h=3]BẬT DEBUG[/h]
define('WP_DEBUG', true); // bật define('WP_DEBUG', false); // tắt define('SCRIPT_DEBUG', true);// Debug javascript


BẬT CACHE




define('WP_CACHE', true);








[h=3]Tùy biến User and Usermeta Tables[/h]
define('CUSTOM_USER_TABLE', $table_prefix.'my_users'); // tên bảng user mới define('CUSTOM_USER_META_TABLE', $table_prefix.'my_usermeta'); // tên bảng usermeta mới


NGÔN NGỮ
define('WPLANG', 'vi'); // Tiếng việt

define('WP_LANG_DIR', $_SERVER['DOCUMENT_ROOT'].'wordpress/languages'); // thư mục chứa ngôn ngữ





[h=3]Hiện query[/h]Chèn vào wp-config.php
define('SAVEQUERIES', true);
Đặt thằng cu này dưới footer
<?php if (current_user_can('administrator')){ global $wpdb; echo "<pre>"; print_r($wpdb->queries); echo "</pre>"; } ?>


[h=3]Xóa thùng rác[/h]
define('EMPTY_TRASH_DAYS', 30 ); // 30 ngày Ko dùng

define('EMPTY_TRASH_DAYS', 0 ); // 0 ngày


[h=3]Tự động tối ưu database[/h]
define('WP_ALLOW_REPAIR', true);





[h=3]Disable the Plugin and Theme Editor[/h]
define('DISALLOW_FILE_EDIT',true);







[h=3]Disable Plugin and Theme Update and Installation[/h]
define('DISALLOW_FILE_MODS',true);
 

Facebook Comments

Similar threads

L
Replies
3
Views
1K
lekien
L
Back
Top