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 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>'; |
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
| /** | |
| * 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; |
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
| /** | |
| * Remove PayPal Standard from displaying at checkout in WooCommerce | |
| */ | |
| function remove_paypal_from_available_payment_gateways( $gateways ) { | |
| unset( $gateways['paypal'] ); | |
| return $gateways; | |
| } | |
| add_filter( 'woocommerce_available_payment_gateways', 'remove_paypal_from_available_payment_gateways' ); |
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( '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; | |
| } ); |
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 add_fontawesome5_to_head() { | |
| echo '<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.12/css/all.css" integrity="sha384-G0fIWCsCzJIMAVNQPfjH08cyYaUtMwjJwqiRKxxE/rx96Uroj1BtIQ6MLJuheaO9" crossorigin="anonymous">'; | |
| } | |
| add_action( 'wp_head', 'add_fontawesome5_to_head' ); |
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 wooslider_lazy_exclude( $blacklisted_classes ) { | |
| $blacklisted_classes = array( | |
| 'skip-lazy', | |
| 'gazette-featured-content-thumbnail', | |
| 'post-image', | |
| ); | |
| return $blacklisted_classes; |
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( 'storefront_handheld_footer_bar_links', 'remove_mobile_links' ); | |
| function remove_mobile_links( $links ) { | |
| unset( $links['cart'] ); | |
| return $links; | |
| } |
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( 'woocommerce_get_image_size_single', 'custom_wc_product_img_size' ); | |
| add_filter( 'woocommerce_get_image_size_shop_single', 'custom_wc_product_img_size' ); | |
| add_filter( 'woocommerce_get_image_size_woocommerce_single', 'custom_wc_product_img_size' ); | |
| function custom_wc_product_img_size() { | |
| $size = array( | |
| 'width' => 800, | |
| 'height' => 800, | |
| 'crop' => 1, | |
| ); |
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_theme_support( 'woocommerce', array( | |
| 'thumbnail_image_width' => 300, | |
| 'single_image_width' => 600, | |
| ) ); |