add_action( 'woocommerce_before_main_content', 'remove_test_category_thumbnails', 10 );
function remove_test_category_thumbnails() {
if (is_product_category('test-category')) {
remove_action('woocommerce_before_shop_loop_item_title' , 'woocommerce_template_loop_product_thumbnail' , 10);
}
}
add_action( 'woocommerce_before_shop_loop_item_title', 'add_test_category_thumbnails', 10 );
function add_test_category_thumbnails() {
global $post;
$testCatThumb = get_post_meta( $post->ID, 'step_dad_mug', true);
if (is_product_category('test-category') && (isset($testCatThumb)) ) {
echo wp_get_attachment_image( $testCatThumb );
}
else
echo woocommerce_get_product_thumbnail();
}
}