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 / color-buttons.html
Last active June 10, 2022 03:39
Sử dụng Genesis Color Buttons
<a class="button-blue" href="https://domain.com">Nội dung hiển thị trong nút bấm</a>
@Kaiderella
Kaiderella / functions.php
Last active June 8, 2022 08:57
Loại bỏ Emoji khỏi WordPress
//* Remove Emoji from WordPress
function disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
@Kaiderella
Kaiderella / gist:31a402372f13bccb730e
Last active June 3, 2022 02:15
Loại bỏ các thẻ HTML được cho phép bên trên khung bình luận trong Genesis
//* Loại bỏ các thẻ HTML được cho phép bên trên khung bình luận trong Genesis
add_filter( 'comment_form_defaults', 'sp_remove_comment_form_allowed_tags' );
function sp_remove_comment_form_allowed_tags( $defaults ) {
$defaults['comment_notes_after'] = '';
return $defaults;
}
@Kaiderella
Kaiderella / gist:346a03cc7470a7133d5e
Last active June 3, 2022 02:14
Tùy biến nút Submit trong Genesis
//* Tùy biến nút Submit trong Genesis
add_filter( 'comment_form_defaults', 'sp_comment_submit_button' );
function sp_comment_submit_button( $defaults ) {
$defaults['label_submit'] = __( 'Đăng bình luận', 'custom' );
return $defaults;
}
@Kaiderella
Kaiderella / gist:c1da858dbbab0c04b03f
Last active June 3, 2022 02:12
Tùy biến dòng chữ Speak Your Mind trong Genesis
//* Tùy biến dòng chữ Speak Your Mind trong Genesis
add_filter( 'comment_form_defaults', 'sp_comment_form_defaults' );
function sp_comment_form_defaults( $defaults ) {
$defaults['title_reply'] = __( 'Để lại một bình luận' );
return $defaults;
}
@Kaiderella
Kaiderella / .htaccess
Last active November 13, 2021 04:08
File .htaccess cho wp-includes
<Files *.php>
Order allow,deny
Deny from all
</Files>
<Files wp-tinymce.php>
Allow from all
</Files>
<Files ms-files.php>
Allow from all
</Files>
@Kaiderella
Kaiderella / .htaccess
Last active November 13, 2021 03:49
File .htaccess cho wp-content và uploads
<Files *.php>
Order allow,deny
Deny from all
</Files>
Options All -Indexes
@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 / functions.php
Last active July 26, 2021 00:22
Tải có điều kiện các file JS và CSS của WooCommerce
//* Conditional load WooCommerce's JS and CSS
function conditionally_load_woc_js_css() {
if (function_exists('is_woocommerce')) {
if (!is_woocommerce() && !is_cart() && !is_checkout() && !is_account_page() && !is_product() && !is_product_category() && !is_shop()) {
wp_dequeue_style('woocommerce-general');
wp_dequeue_style('woocommerce-layout');
wp_dequeue_style('woocommerce-smallscreen');
wp_dequeue_style('woocommerce_frontend_styles');
wp_dequeue_style('woocommerce_fancybox_styles');
wp_dequeue_style('woocommerce_chosen_styles');
@Kaiderella
Kaiderella / .htaccess
Last active July 22, 2021 02:19
Tập tin .htaccess mặc định của WordPress
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress