Skip to content

Instantly share code, notes, and snippets.

@jdiaz1302
jdiaz1302 / Control de Cache Opcion 2.htaccess
Created Oct 10, 2016
Como optimizar WordPress con .htaccess
View Control de Cache Opcion 2.htaccess
# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "max-age=216000, private"
@jdiaz1302
jdiaz1302 / Control de Cache.htaccess
Created Oct 10, 2016
Como optimizar WordPress con .htaccess
View Control de Cache.htaccess
# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "private"
@jdiaz1302
jdiaz1302 / Expirar Encabezados.htaccess
Created Oct 10, 2016
Como optimizar WordPress con .htaccess
View Expirar Encabezados.htaccess
#BEGIN EXPIRES HEADERS
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default expiration: 1 hour after request
ExpiresDefault "now plus 1 hour"
# CSS and JS expiration: 1 week after request
ExpiresByType text/css "now plus 1 week"
ExpiresByType application/javascript "now plus 1 week"
ExpiresByType application/x-javascript "now plus 1 week"
@jdiaz1302
jdiaz1302 / GZIP.htaccess
Created Oct 10, 2016
Como optimizar WordPress con .htaccess
View GZIP.htaccess
# BEGIN 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)$
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.*
@jdiaz1302
jdiaz1302 / DEFLATE.htaccess
Created Oct 10, 2016
Como optimizar WordPress con .htaccess
View DEFLATE.htaccess
# BEGIN DEFLATE COMPRESSION
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
View utf8-wp-config.php
//Definir UTF-8 en wp-config
define('DB_CHARSET', 'utf-8');
View CODED-DOC.html
//HTML5
<meta charset=”utf-8″ />
//HTML 4
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /> (HTML 4)
@jdiaz1302
jdiaz1302 / woo-sku-functions.php
Created Sep 25, 2016
This is used to change the word SKU on WooCommerce
View woo-sku-functions.php
/*
Replace SKU on WooCommerce for Other word.
*/
add_filter('gettext', 'change_sku', 999, 3);
function change_sku( $translated_text, $text, $domain ) {
if( $text == 'SKU' || $text == 'SKU:' ) return 'CODE';
return $translated_text;
}
View gist:6def64fcd53cc9060742
/**
* Embed Gists with a URL
*
* Usage:
* Paste a gist link into a blog post or page and it will be embedded eg:
* https://gist.github.com/2926827
*
* If a gist has multiple files you can select one using a url in the following format:
* https://gist.github.com/2926827?file=embed-gist.php
*