Skip to content

Instantly share code, notes, and snippets.

@om4james
Created May 1, 2015 04:45
Show Gist options
  • Save om4james/4104c2adc15a95cd93ef to your computer and use it in GitHub Desktop.
Save om4james/4104c2adc15a95cd93ef to your computer and use it in GitHub Desktop.
WooCommerce wrap product category/subcategory images in the loop (shop/archive pages)
<?php
/**
* Archives: wrap the category/subcategory image/thumbnail in a div.
*
* The category image itself is hooked in at priority 10 using woocommerce_subcategory_thumbnail(),
* so priority 9 and 11 are used to open and close the div.
*/
add_action( 'woocommerce_before_subcategory_title', function(){
echo '<div class="imagewrapper">';
}, 9 );
add_action( 'woocommerce_before_subcategory_title', function(){
echo '</div>';
}, 11 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment