我试图在商店页面(woocommerce)中显示产品数量作为我的要求,但以下代码似乎不再适用于最新版本的WooCommerce
add_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 20 );
function new_loop_shop_per_page( $cols ) {
// $cols contains the current number of products per page based on the value stored on Options -> Reading
// Return the number of products you wanna show per page.
$cols = 9;
return $cols;
}