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
/** | |
* MENU SHORTCODE | |
* Display any menu using the menu slug | |
*/ | |
function print_menu_shortcode($atts, $content = null) { | |
extract(shortcode_atts(array( 'name' => null, ), $atts)); | |
return wp_nav_menu( array( 'menu' => $name, 'echo' => false ) ); | |
} | |
add_shortcode('menu', 'print_menu_shortcode'); |
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
add_action( 'init', 'mw_gettext_filter_woocommerce', 9999 ); | |
/** | |
* Change the text in WooCommerce for "Shipping and taxes are estimated..." via Gettext filter. | |
* | |
* @author David Decker - DECKERWEB | |
* @link http://twitter.com/deckerweb | |
*/ | |
function mw_gettext_filter_woocommerce() { | |
add_filter( 'gettext', 'ddw_woocommerce_change_estimated_shipping_taxes_text', 9999, 2 ); |
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
// Increase class-level specificity of a rule without functionaly modifying the selector | |
@mixin increase-specificity( $depth: 1 ) { | |
$sel : ''; | |
@while($depth > 0) { | |
$sel : $sel + ':nth-child(n)'; | |
$depth : $depth - 1; | |
} | |
&#{$sel} { |
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
add_action( 'genesis_before_loop', 'mw_genesis_after_header_sidebars' ); | |
function mw_genesis_after_header_sidebars() | |
{ | |
genesis_widget_area( 'utilities-header', array( | |
'before' => '<div class="widget-area utilities-header">', | |
'after' => '</div>', | |
) ); | |
} |
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
/** | |
* Desabilita pagamento por Transferência para clientes não PT | |
*/ | |
function mw_payment_gateway_disable_country( $available_gateways ) | |
{ | |
global $woocommerce; | |
if ( isset( $available_gateways['bacs'] ) && $woocommerce->customer->get_country() !== 'PT' ) { | |
unset( $available_gateways['bacs'] ); | |
} |
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 | |
/** | |
* Redirect users to custom URL based on their role after login | |
* | |
* @param string $redirect | |
* @param object $user | |
* @return string | |
*/ | |
function wc_custom_user_redirect( $redirect, $user ) { | |
// Get the first of all the roles assigned to the user |
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
'use strict'; | |
var gulp = require('gulp'), | |
connect = require('gulp-connect'), | |
gulpLoadPlugins = require('gulp-load-plugins'), | |
cleanhtml = require('gulp-cleanhtml'), | |
dev = require('gulp-dev'), | |
browserSync = require('browser-sync'), | |
plugins = gulpLoadPlugins(), | |
webpack = require('webpack'), |
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 class to .site-container | |
add_filter('genesis_attr_site-container', 'jive_attributes_st_container'); | |
function jive_attributes_st_container($attributes) { | |
$attributes['class'] .= ' st-container'; | |
return $attributes; | |
} | |
//* Add class to .site-inner |
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
/** | |
* Mostra as categorias associadas ao tema | |
*/ | |
add_action( 'woocommerce_after_shop_loop_item_title', 'mw_archive_add_theme_category', 5 ); | |
function mw_archive_add_theme_category() | |
{ | |
global $product; | |
$out = '<div class="product-categories">'; | |
$out .= strip_tags( $product->get_categories() ); |