Skip to content

Instantly share code, notes, and snippets.

View Kaiderella's full-sized avatar
🏠
Working from home

Hieu Bui Trung Kaiderella

🏠
Working from home
View GitHub Profile
@Kaiderella
Kaiderella / wp-config.php
Created March 21, 2017 07:31
Thời gian giữa 2 lần tự động lưu
define ('AUTOSAVE_INTERVAL', 160);
@Kaiderella
Kaiderella / wp-config.php
Last active March 21, 2017 07:30
Không lưu bản thảo
define ('WP_POST_REVISIONS', false);
@Kaiderella
Kaiderella / wp-config.php
Created March 21, 2017 07:29
Thiết lập số lượng bản thảo
define ('WP_POST_REVISIONS', 3);
@Kaiderella
Kaiderella / wp-config.php
Created March 21, 2017 07:26
Không lưu trash
define ('EMPTY_TRASH_DAYS', 0);
@Kaiderella
Kaiderella / wp-config.php
Created March 21, 2017 07:25
Lưu trữ trash trong 7 ngày
define ('EMPTY_TRASH_DAYS', 7);
@Kaiderella
Kaiderella / functions.php
Created March 20, 2017 07:16
Comments policy
//* Comments policy
add_action( 'genesis_after_comments', 'sp_comment_policy' );
function sp_comment_policy() {
if ( is_single() && !is_user_logged_in() && comments_open() ) {
?>
<div class="comment-policy-box">
<p class="comment-policy"><strong>Lưu ý:</strong></br>> Không sử dụng từ khóa trong mục "Tên". </br>> Hãy sử dụng tên thật và địa chỉ email của bạn.</br>> Vui lòng bình luận bằng tiếng Việt có dấu.</p>
</div>
<?php
}
@Kaiderella
Kaiderella / wpcb ping list
Last active September 3, 2021 08:14
WordPress ping list của WP Căn bản
http://rpc.pingomatic.com/
http://bing.com/webmaster/ping.aspx
http://ping.blo.gs/
http://blog.goo.ne.jp/XMLRPC
http://blog.with2.net/ping.php
http://blogping.unidatum.com/RPC2
http://blogpingr.de/ping/rpc2
https://ping.blogs.yandex.ru/RPC2
http://blogsearch.google.ae/ping/RPC2
http://blogsearch.google.at/ping/RPC2
@Kaiderella
Kaiderella / info.php
Created March 15, 2017 02:15
Kiểm tra thông số PHP
<?php
phpinfo ();
?>
@Kaiderella
Kaiderella / comments.php
Created March 3, 2017 04:39
Bộ đếm bình luận trong WordPress
echo wpcb_count_user_comments();
@Kaiderella
Kaiderella / functions.php
Last active March 3, 2017 04:36
Bộ đếm số lượng bình luận
function wpcb_count_user_comments() {
global $wpdb;
$count = $wpdb->get_var(
'SELECT COUNT(comment_ID) FROM ' . $wpdb->comments. '
WHERE comment_author_email = "' . get_comment_author_email() . '"
AND comment_approved = "1"
AND comment_type IN ("comment", "")'
);
return $count . ' comments';