View gist:5805532
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_filter( 'woo_breadcrumbs_trail', 'woo_custom_filter_breadcrumbs_trail', 10 ); | |
function woo_custom_filter_breadcrumbs_trail ( $trail ) { | |
foreach ( $trail as $k => $v ) { | |
if ( strtolower( strip_tags( $v ) ) == 'products' ) { | |
$trail[$k] = 'Photos'; | |
break; | |
} | |
} | |
return $trail; | |
} // End woo_custom_filter_breadcrumbs_trail() |
View fa-box-shorcode.exmple
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
[box icon="fa-wordpress" color="blue" url="https://wordpress.org"]Visit WordPress.org[/box] |
View storefront-custom-homepage-shortcode-section.php
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
function sf_output_custom_shortcode_section() { | |
echo '<section class="storefront-product-section storefront-product-category">'; | |
echo '<h2 class="section-title">' . __( 'Music Category', 'storefront' ) . '</h2>'; | |
echo do_shortcode( '[product_category category="music" columns="4" per_page="4"]' ); | |
echo '</section>'; |
View remove-storefront-cart-link-header.php
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
function remove_sf_actions() { | |
remove_action( 'storefront_header', 'storefront_header_cart', 60 ); | |
} | |
add_action( 'init', 'remove_sf_actions' ); |
View woocommerce-bookings-change-single-add-to-cart-text.php
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
function change_booking_single_add_to_cart_text() { | |
echo 'Changed Text'; | |
} | |
add_filter( 'woocommerce_booking_single_add_to_cart_text','change_booking_single_add_to_cart_text' ); |
View woocommerce-change-gravity-forms-product-addons-select-options-text.php
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
function change_gravity_add_to_cart() { | |
return 'Changed Text'; | |
} | |
add_filter( 'woocommerce_gforms_add_to_cart_text', 'change_gravity_add_to_cart' ); |
View remove-free-shipping-if-coupon-used.php
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_filter( 'woocommerce_shipping_packages', function( $packages ) { | |
$applied_coupons = WC()->session->get( 'applied_coupons', array() ); | |
if ( ! empty( $applied_coupons ) ) { | |
$free_shipping_id = 'free_shipping:2'; | |
unset($packages[0]['rates'][ $free_shipping_id ]); | |
} | |
return $packages; | |
} ); |
View wc-remove-billing-fields-required.php
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
/** | |
* Sets all WooCommerce billing fields to be unrequired. | |
*/ | |
function wc_unrequire_billing_fields( $fields ) { | |
$fields['billing_first_name']['required'] = false; | |
$fields['billing_last_name']['required'] = false; | |
$fields['billing_company']['required'] = false; | |
$fields['billing_country']['required'] = false; | |
$fields['billing_address_1']['required'] = false; | |
$fields['billing_city']['required'] = false; |
View sf-fw-wooslider
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
/** | |
* Adds wooslider into the storefront_before_content action in the parent themes header.php file. | |
*/ | |
function sd_storefront_homepage_slider() { | |
// if not the StoreFront Homepage Page Template return false | |
if ( ! is_page_template( 'template-homepage.php' ) ) { | |
return false; |
View storefront-custom-homepage-text-section.php
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
function sf_output_custom_text_section() { | |
echo '<section class="storefront-product-section storefront-product-category">'; | |
echo '<h2 class="section-title">' . __( 'Text Title', 'storefront' ) . '</h2>'; | |
echo '<p>This is some text blurb</p>'; | |
echo '</section>'; |