Replies: 1 comment 1 reply
-
You're right, this function is not wrapped in the // Add card-img-top class to product loop
if (!function_exists('custom_loop_product_thumbnail')) :
remove_action('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
add_action('woocommerce_before_shop_loop_item_title', 'custom_loop_product_thumbnail', 10);
function custom_loop_product_thumbnail() {
global $product;
$size = 'woocommerce_thumbnail';
$code = 'class=card-img-top';
$image_size = apply_filters('single_product_archive_thumbnail_size', $size);
echo $product ? $product->get_image($image_size, $code) : '';
}
endif; While we are here, let's change @RobertCrx Want to create a pull request? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I am trying to replace the function ->
But it seems it doesn't work. I created another action function and added a priority of 5, I tried to remove action , but nothing happens. What should I do if I want to recreate the loop woocommerce structure ?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions