最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wordpress - WooCommerce Admin Panel Image Sizes - Stack Overflow

programmeradmin0浏览0评论

We already use the 300x300 images in many places. The only places that still have 100x100 is the admin panel of Woocommerce, on the product list and then the product gallery inside the product creation page. Can we add something to functions to force the admin panel to also use 300x300 so we can delete every 100x100 image to free up inode usage?

We added the below code to functions, which changed the product gallery on the product page, but should this change the admin side too? we have also changed the base wordpress thumbnail size to 300. Maybe we just need to regerate all thumbnails then delete the 100x100? or delete then regenerate

// change woocommerce thumbnail image size
add_filter( 'woocommerce_get_image_size_gallery_thumbnail', 'override_woocommerce_image_size_gallery_thumbnail' );
function override_woocommerce_image_size_gallery_thumbnail( $size ) {
    // Gallery thumbnails: proportional, max width 200px
    return array(
        'width'  => 300,
        'height' => 300,
        'crop'   => 0,
    );
}

UPDATED for anyone who comes across this in future:

Just wanted to update this for anyone who comes across the same question in future...

The above does affect the single product page & also the admin side of WooCommerce (product list/product gallery/order screen/cart page). You may not have a 300x300 image to replace it with though.

You can of course edit the code above and change 300 to something else (insert it into functions.php).

I used Regenerate Thumbnails Advanced - /. Just ensure you are not adding any new sizes on the top right. And it seems "Force Regeneration is also important! Or it wont work. Once that is complete, you can go ahead and delete all the 100x100 images on the server (IF you dont use them anywhere already).

Thumbnail Regenerate

发布评论

评论列表(0)

  1. 暂无评论