目录页上的商品描述和简短的描述变得杂乱无章。这使得每个产品都不同,我更希望每个产品在目录网格中占据更多的相同空间。因此,我想从目录页面中删除该产品的描述,并仅在用户选择产品时才在单个产品页面中显示它。如果可能的话,我也希望搜索功能不包括从产品简短的描述文本。任何建议都将不胜感激。
发布于 2018-01-04 13:58:18
function filter_woocommerce_short_description( $post_post_excerpt ) {
if(is_shop() || is_product_category() ) {
return false;
} else {
return $post_post_excerpt;
}
};
// add the filter
add_filter( 'woocommerce_short_description', 'filter_woocommerce_short_description', 10, 1 );
https://stackoverflow.com/questions/37365734
复制