Skip to content

Instantly share code, notes, and snippets.

View thesaurabhk's full-sized avatar

Saurabh K thesaurabhk

View GitHub Profile
#
# Firstly, I created a child theme.
# Now, create a single.php file in your child theme folder. I would recommend using a plugin to copy the single.php file from Parent Theme Folder to Child Theme Folder.
# Now copy and paste the below-given code in the single.php file of your child theme, in between div tags of the post author.
#
# TN START – ADD AUTHOR BOX IN WORDPRESS WITHOUT PLUGIN
<h4 class="about-the-author">About The Author</h4>
#
# Paste the following code into your .Htaccess file
# Don’t forget to change sample.com with your own domain name.
# If you don’t want to enable caching on multiple domains delete the hyphen (|) and other domains.
#
# TN – ENABLE LITESPEED CACHE START
<IfModule LiteSpeed>
CacheEnable public
#
# Paste the following code into your .Htaccess file
#
# TN – ENABLE MOD PAGESPEED START
# COMBINE CSS, COMPRESS IMAGES, REMOVE HTML WHITE SPACE AND COMMENTS
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedEnableFilters rewrite_css,combine_css
#
# Paste the following code into your .Htaccess file
# Do not forget to replace sample.com with your own domain name
#
# TN – DISABLE IMAGE HOTLINKIING START
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?sample.com [NC]
#
# Paste the following code into your .Htaccess file
#
# TN - BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
#
# Paste the following code into your .Htaccess file
#
# TN - START EXPIRES CACHING #
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
#
# Paste the following code into your .Htaccess file
#
# TN START ENABLE KEEP ALIVE
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
# TN END ENABLE KEEP ALIVE
#
# Paste the following code in the configuration file of your web Nginx server
#
gzip on;
gzip_comp_level 2;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 1100;
gzip_buffers 16 8k;
#
# Paste the following code into your .Htaccess file
#
# TN START GZIP COMPRESSION
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
<?php
//* You don't need to add the opening php tag shown above.
//* Only copy and paste the below given code in functions.php file.
//* TN Dequeue Styles - Remove Google Fonts form Divi Theme
add_action( 'wp_print_styles', 'tn_dequeue_divi_fonts_style' );
function tn_dequeue_divi_fonts_style() {
wp_dequeue_style( ‘divi-fonts' );
wp_deregister_style( ‘divi-fonts' );