【发布时间】:2021-05-09 19:24:03
【问题描述】:
你好,我把function.php改成了
/**
* Change number of products that are displayed per page (shop page)
*/
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;
}
现在我的商店没有在商店页面中显示商品商店 现在我想恢复默认值,我删除了我的 function.php 中的行,但仍然无法正常工作。我必须添加哪个过滤器才能返回?
【问题讨论】:
-
只需从活动主题的 functions.php 文件中删除代码并保存。如果启用,请清空您的站点缓存。否则,在您的站点上恢复数据库备份。
-
@LoicTheAztec 我这样做了,但仍然什么也看不到:(
-
@LoicTheAztec 现在我可以再次看到它,但是这段代码不起作用它是缓存的东西
标签: php wordpress woocommerce wordpress-theming website-homepage