Skip to content

Instantly share code, notes, and snippets.

@codekipple
Created June 27, 2020 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codekipple/e5f40e904eece205d425cda6526cb8fa to your computer and use it in GitHub Desktop.
Save codekipple/e5f40e904eece205d425cda6526cb8fa to your computer and use it in GitHub Desktop.
<?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