Criação de um formulário via Contact Form 7 com select personalizado com Option Group para seleção de departamentos.
Download do Contact Form 7
Criação de um formulário via Contact Form 7 com select personalizado com Option Group para seleção de departamentos.
Download do Contact Form 7
<?php | |
/** | |
* Returns ID of top-level parent category, or current category if you are viewing a top-level | |
* | |
* @param string $catid Category ID to be checked | |
* @return string $catParent ID of top-level parent category | |
*/ | |
function smart_category_top_parent_id ($catid) { | |
while ($catid) { | |
$cat = get_category($catid); // get the object for the catid |
<?php | |
function hex2RGB($hex) { | |
$hex = str_replace("#", "", $hex); | |
if(strlen($hex) == 3) { | |
$r = hexdec(substr($hex,0,1).substr($hex,0,1)); | |
$g = hexdec(substr($hex,1,1).substr($hex,1,1)); | |
$b = hexdec(substr($hex,2,1).substr($hex,2,1)); | |
} else { | |
$r = hexdec(substr($hex,0,2)); | |
$g = hexdec(substr($hex,2,2)); |
// <![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) { |
//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); |
var $window = $(window), $html = $('html'); | |
$window.resize(function resize(){ | |
if ($window.width() < 415) { | |
return $html.addClass('mobile'); | |
} | |
$html.removeClass('mobile'); | |
}).trigger('resize'); |
<?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, |
<?php | |
function chr_redirect_post_type() { | |
global $wp_query; | |
if ( is_post_type_archive('sliders') || is_singular('sliders') ) : | |
$url = get_bloginfo('url'); | |
wp_redirect( esc_url_raw( $url ), 301 ); | |
exit(); | |
endif; | |
} | |
add_action ( 'template_redirect', 'chr_redirect_post_type', 1); |
<?php | |
// Remove o Field de Informação adicional | |
add_filter( 'woocommerce_checkout_fields' , 'alter_woocommerce_checkout_fields' ); | |
function alter_woocommerce_checkout_fields( $fields ) { | |
unset($fields['order']['order_comments']); | |
return $fields; | |
} | |
// Remove o título de Informação adicional | |
add_filter( 'woocommerce_enable_order_notes_field', '__return_false' ); |
<?php | |
/* | |
* Function - Disable Checkout for some Countries and States | |
*/ | |
function wc_checkout_validation() { | |
$shipping_country = ! empty( $_POST['shipping_country'] ) ? $_POST['shipping_country'] : $_POST['billing_country']; | |
$shipping_state = ! empty( $_POST['shipping_state'] ) ? $_POST['shipping_state'] : $_POST['billing_state']; | |
// Add here States : More example look here -> wp-content/plugins/woocommerce/i18n/states/ |