Created
June 27, 2020 17:29
-
-
Save codekipple/e5f40e904eece205d425cda6526cb8fa to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Shop/archives: wrap the product image/thumbnail in a div. | |
* | |
* The product image itself is hooked in at priority 10 using woocommerce_template_loop_product_thumbnail(), | |
* so priority 9 and 11 are used to open and close the div. | |
*/ | |
add_action( 'woocommerce_before_shop_loop_item_title', function(){ | |
echo '<div class="imagewrapper">'; | |
}, 9 ); | |
add_action( 'woocommerce_before_shop_loop_item_title', function(){ | |
echo '</div>'; | |
}, 11 ); | |
// remove default ordering select dropdown | |
remove_action('woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30); | |
// remove result count | |
remove_action('woocommerce_before_shop_loop', 'woocommerce_result_count', 20); | |
// remove add to cart link | |
remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10); | |
// Trim zeros in price decimals | |
add_filter('woocommerce_price_trim_zeros', '__return_true'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment