Skip to content

Instantly share code, notes, and snippets.

// tùy biến breadcrumb
function b3m_prefix_breadcrumb( $args ) {
$args['labels']['prefix'] = '';
return $args;
}
add_filter( 'genesis_breadcrumb_args', 'b3m_prefix_breadcrumb' );
function b3m_home_text_breadcrumb( $args ) {
$args['home'] = 'Trang chủ';
return $args;
}
@leducson1
leducson1 / lang
Created June 9, 2017 02:19
Them the language
// Meta langguage
add_filter('language_attributes', 'custom_lang');
function custom_lang() {
return 'lang="vi"';
}
@leducson1
leducson1 / kich hoat litespeed
Created June 11, 2017 13:32
code kích hoạt litespeed cache
<IfModule LiteSpeed>
CacheEnable public /
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(HEAD|GET)$
RewriteCond %{REQUEST_URI} !^/(wp-admin|wp-login.php|wp-cron.php)
RewriteRule .* - [E=Cache-Control:max-age=120]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# protect file .htaccess:
<Files ~ “^.*\.([Hh][Tt][Aa])”>
order allow,deny
deny from all
satisfy all
</Files>
Order deny,allow
Deny from all
<Files ~ ".(xml|css|jpe?g|png|gif|js)$">
Allow from all
</Files>
<Files wp-config.php>
order allow,deny
deny from all
</Files>
@leducson1
leducson1 / gist:a9d24cf0a679b1196210cba61f7e5a7c
Created June 13, 2017 09:17
Chỉ cho phép 1 ip nào đó đăng nhập
order deny,allow
allow from 113.134.156.46
deny from all
@leducson1
leducson1 / gist:a1dbaf3ced17fb59c3880458140f7dd4
Last active July 4, 2017 04:37
Leverage browser caching
# Leverage browser caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
[su_button url="https://sachphaidoc.com" target="blank" background="#2DB717" size="4" icon_color="#ffffff"]Đặt sách[/su_button]