admin管理员组文章数量:1391985
I changed on two specific category layout to 3 and 2 columns. Now i can't figure out how can i change picture sizes on these categories, at moment they are upscaled and quality is low.
add_filter( 'subcategory_archive_thumbnail_size', function( $size ) {
if ( function_exists( 'is_product_category' ) && is_product_category( 'twilight' ) ) {
return 'full';
}
return $size;
} );
Code used to change category columns
add_filter('loop_shop_columns', 'loop_columns');
if (!function_exists('loop_columns')) {
function loop_columns() {
if ( is_product_category('a')) {
return 3;
} else if ( is_product_category('b')) {
return 2;
}else{
return 6;
}
}
}
I changed on two specific category layout to 3 and 2 columns. Now i can't figure out how can i change picture sizes on these categories, at moment they are upscaled and quality is low.
add_filter( 'subcategory_archive_thumbnail_size', function( $size ) {
if ( function_exists( 'is_product_category' ) && is_product_category( 'twilight' ) ) {
return 'full';
}
return $size;
} );
Code used to change category columns
add_filter('loop_shop_columns', 'loop_columns');
if (!function_exists('loop_columns')) {
function loop_columns() {
if ( is_product_category('a')) {
return 3;
} else if ( is_product_category('b')) {
return 2;
}else{
return 6;
}
}
}
Share
Improve this question
asked Jan 24, 2020 at 11:57
ufo56ufo56
1
1 Answer
Reset to default 0You can use category id using
if ( is_product_category('your category id') ){
Change your product size
}
Please refer to this LINK
本文标签: Change woocommerce one category image size
版权声明:本文标题:Change woocommerce one category image size 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744717505a2621491.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论