Skip to content

Instantly share code, notes, and snippets.

View manhleo93's full-sized avatar

Đức Mạnh manhleo93

View GitHub Profile
<div><?php echo category_description(); ?></div>
Last updated on <time datetime="<?php the_modified_time('Y-m-d'); ?>"><?php the_modified_time('F jS, Y'); ?></time>
@manhleo93
manhleo93 / single.php
Created January 25, 2018 12:53
thêm cập nhật cuối wordpress
<?php the_time('F j Y'); ?>
@manhleo93
manhleo93 / .htaccess
Created January 20, 2018 09:38
Hướng dẫn chặn hotlinking bằng file .htaccess
#disable hotlinking of images with forbidden or custom image option
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?sampres.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?google.com [NC]
RewriteRule .(jpg|jpeg|png|gif)$ – [NC,F,L]
@manhleo93
manhleo93 / functions.php
Created January 20, 2018 09:10
Loại bỏ Query String trong WordPress
# Loại bỏ Query String trong WordPress
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
@manhleo93
manhleo93 / .htaccess
Created January 20, 2018 07:17
Bật tính năng nén Gzip .htaccess wordpress
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
@manhleo93
manhleo93 / .htaccess
Created January 20, 2018 07:16
Bật tính năng nén Gzip .htaccess wordpress
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
http://ttvnol.com
http://diendandulich.net.vn
https://www.webtretho.com
https://forum.vietnam.biz
https://cungbandulich.com
@manhleo93
manhleo93 / functions.php
Created January 15, 2018 09:52
Tắt tự động cập nhật theme và plugin wordpress
# Tắt tính năng tự động cập nhật Plugin WordPress
add_filter( 'auto_update_plugin', '__return_false' );
# Tắt tính năng tự động cập nhật Theme WordPress
add_filter( 'auto_update_theme', '__return_false' );
define( 'WP_AUTO_UPDATE_CORE', false );