This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ https://%1/$1 [R=301,L] | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** * Use GD instead of Imagick. | |
*/ | |
function chr_use_gd_editor($array) { | |
return array( 'WP_Image_Editor_GD' ); | |
} | |
add_filter( 'wp_image_editors', 'chr_use_gd_editor' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create the VAR for get browser size | |
var windowWidth = $(window).width(); | |
$(window).bind('resize', function(e) { | |
//Verification with my VAR windowWidth is different Window size | |
if(windowWidth != $(window).width()){ | |
//Create a delay for reload | |
if (window.RT) clearTimeout(window.RT); window.RT = setTimeout(function() { | |
this.location.reload(false); | |
}, 200); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wc_add_to_cart_message', 'custom_add_to_cart_message' ); | |
function custom_add_to_cart_message( $product_id ) { | |
$product_id = $_REQUEST[ 'product_id' ]; | |
if ( is_array( $product_id ) ) { | |
$titles = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.filterBlog a').on('click', function(e) { | |
filterBlogHash(this.hash, e); | |
}); | |
$(window).on('load',function() { | |
filterBlogHash(window.location.hash); | |
}); | |
function filterBlogHash(hash, e) { | |
if(hash === '') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.filterBlog').on('click', 'a', function(e){ | |
e.preventDefault(); | |
var hash = $(this).attr('href').replace(/^.*?(#|$)/,''); | |
$('.filter a.type').each(function (index, value) { | |
// console.log('filter' + index + ':' + $(this).attr('id')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Brazillian states | |
* Function - Vender Somente para Estados Específicos - WooCommerce | |
*/ | |
function wc_especifico_estado( $states ) { | |
$states['BR'] = array( | |
'SP' => __( 'São Paulo', 'woocommerce' ), | |
'RJ' => __( 'Rio de Janeiro', 'woocommerce' ), | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Related Posts. | |
* | |
* Usage: | |
* To show related by categories: | |
* Add in single.php <?php chr_related_posts(); ?> | |
* To show related by tags: | |
* Add in single.php <?php chr_related_posts( 'tag' ); ?> | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$post_type = 'post'; | |
// Get all the taxonomies for this post type | |
$taxonomies = get_object_taxonomies( (object) array( 'post_type' => $post_type ) ); | |
foreach( $taxonomies as $taxonomy ) : | |
// Gets every "category" (term) in this taxonomy to get the respective posts | |
$terms = get_terms( $taxonomy, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <![CDATA[ | |
jQuery(function($) { | |
$.mask.definitions['~']='[+-]'; | |
//Inicio Mascara Telefone | |
$('input[type=tel]').focusout(function(){ | |
var phone, element; | |
element = $(this); | |
element.unmask(); | |
phone = element.val().replace(/\D/g, ''); | |
if(phone.length > 10) { |
NewerOlder