WooCommerce 미리보기 자르기 위치를 변경하려고합니다. 이 코드는 크기를 변경하는 데 도움이 될 수 있습니다 발견WooCommerce 축소판 자르기 위치를 변경하는 방법?
add_action('init', 'yourtheme_woocommerce_image_dimensions', 1);
/**
* Define image sizes
*/
function yourtheme_woocommerce_image_dimensions() {
$catalog = array(
'width' => '100', // px
'height' => '100', // px
'crop' => 0
);
// Image sizes
update_option('shop_catalog_image_size', $catalog); // Product category thumbs
}
내가 약간의 변화 작물 0
에 array("center", "bottom")
같은 노력 않았다을하지만 그것은 작동하지 않습니다 :이
function yourtheme_woocommerce_image_dimensions() {
$catalog = array(
'width' => '300', // px
'height' => '400', // px
'crop' => 'array("center", "bottom")'
);
// Image sizes
update_option('shop_catalog_image_size', $catalog); // Product category thumbs
}
그리고를 성공하지 :
if (function_exists('add_image_size')){
add_image_size('shop_catalog', 300, 400, array('center', 'bottom'));
}
어쨌든 변경할 수 있습니까?
감사합니다.
. 감사! –