Woocommerce 商店页面类别图片

Woocommerce Shop Page Category Images

所以目前类别的图像是一组 height/width 是否可以设置它,使其不调整大小,而是随图像大小变化。 站点:http://www.timandted.com/shop/ 示例:http://goo.gl/0KLCah

是的...您需要更新图像循环的输出...

remove_action('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
    add_action('woocommerce_before_shop_loop_item_title', 'new_woocommerce_template_loop_product_thumbnail', 10);

    function new_woocommerce_template_loop_product_thumbnail() {
       echo '<img src="' . wp_get_attachment_image_src(get_post_thumbnail_id(), 'full') . '">';
        }

你也可以这样使用:

    remove_action('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
    add_action('woocommerce_before_shop_loop_item_title', 'new_woocommerce_template_loop_product_thumbnail', 10);

   function new_woocommerce_template_loop_product_thumbnail() {
            $new_image_src = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
            echo '<img src="' . $new_image_src . '">';
    }

如果您想使用目录大小并调整元素中的某些尺寸,您可以使用 wp_get_attachment_image_src(get_post_thumbnail_id(), 'shop_catalog') 拉入目录裁剪图像。