Como alterar a posição de corte das miniaturas do WooCommerce?
Estou tentando alterar a posição de corte em miniatura do WooCommerce. Eu descobri que esse código pode ajudar a alterar o tamanho:
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
}
Eu tentei mudar a colheita0
paraarray("center", "bottom")
mas não está funcionando:
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
}
E também isso sem sucesso:
if (function_exists( 'add_image_size' )){
add_image_size( 'shop_catalog', 300, 400, array( 'center', 'bottom' ) );
}
Existe alguma maneira que eu possa mudar isso?
Obrigado.