This file contains hidden or 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
| ** | |
| * woocommerce_package_rates is a 2.1+ hook | |
| */ | |
| add_filter( 'woocommerce_package_rates', 'hide_shipping_when_free_is_available', 10, 2 ); | |
| /** | |
| * Hide shipping rates when free shipping is available | |
| * | |
| * @param array $rates Array of rates found for the package | |
| * @param array $package The package array/object being shipped |
This file contains hidden or 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
| .mini-cart { | |
| display: block; | |
| float: right; | |
| font-size: 16px; | |
| line-height: 1; | |
| margin-left: 2em; | |
| padding: 30px 24px; | |
| } | |
| .mini-cart .amount { | |
| margin-right: 1em; |
This file contains hidden or 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( 'wp_nav_menu_items', 'wpstudio_search_primary_nav_menu', 10, 2 ); | |
| /** | |
| * @author Frank Schrijvers | |
| * @example https://www.wpstud.io | |
| */ | |
| function wpstudio_search_primary_nav_menu( $menu, stdClass $args ){ | |
| if ( 'primary' != $args->theme_location ) | |
| return $menu; |
This file contains hidden or 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 WooCommerce cart to primary navigation Genesis | |
| * @author Frank Schrijvers | |
| * @link https://www.wpstud.io/add-woocommerce-cart-to-genesis-navigation/ | |
| */ | |
| if ( class_exists( 'WooCommerce' ) ) { | |
| add_action( 'genesis_header_right', 'wpstudio_add_cart' ); | |
| function wpstudio_add_cart() { | |
| echo '<div class="mini-cart">'; | |
| echo '<a href="' . WC()->cart->get_cart_url() .'"title="View your shopping cart">'. WC()->cart->get_cart_total(). '</a>'; |
This file contains hidden or 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
| //* Declare WooCommerce Support | |
| add_theme_support( 'woocommerce' ); |
This file contains hidden or 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
| //* Declare WooCommerce Support | |
| add_theme_support( 'woocommerce' ); |
This file contains hidden or 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 | |
| /** | |
| * WooCommerce Template | |
| * | |
| * Template used for all WooCommerce views for your site | |
| * | |
| */ | |
| //* Remove standard post content output | |
| remove_action( 'genesis_loop', 'genesis_do_loop'); |
This file contains hidden or 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 woocommerce_setup_genesis() { | |
| woocommerce_content(); | |
| } |
This file contains hidden or 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
| /* | |
| -------------------------------- | |
| Infinite Scroll Behavior | |
| Masonry Integration | |
| -------------------------------- | |
| + https://github.com/paulirish/infinitescroll/ | |
| + version 2.0b2.110617 | |
| + Copyright 2011 Paul Irish & Luke Shumard | |
| + Licensed under the MIT license | |
This file contains hidden or 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 custom post class to posts | |
| add_filter('post_class', 'wpstudio_custom_post_class'); | |
| function wpstudio_custom_post_class($classes) { | |
| $new_class = 'brick'; | |
| $classes[] = esc_attr(sanitize_html_class($new_class)); | |
| return $classes; | |
| } |