duanba7498 2015-05-10 05:03
浏览 27
已采纳

如何避免产品在WooCommerce中的分类限制?

Recently I'm faced with an interesting effect which seems to go with default settings.

When you just display products in mixed order it's ok, but when you're trying to create custom category for them - there are I'm getting the limit for loop: only 12 products are displayed in tab for category's list. E.g.:

there are 12 items of watches in "Men watches" tab:

here are 12 items of watches

but in fact, there are 16 of them:

enter image description here

Usually I add categories this way using standart form:

enter image description here

and add products to them:

enter image description here

In my functions.php file I added the line to extend the amount of products globally, but it didn't help:

enter image description here

Why the amount of rendered products by their categories is limited? Where to find the code that is in charge of this case?

  • 写回答

1条回答 默认 最新

  • doulu4976 2015-05-10 08:57
    关注

    There are two options you could give a try:

    1. If you are filtering by category, you are probably using the

    ["product_category"]

    where the default per_page attribute is set to be 12. You can override that by specifying the per_page="16".

    1. Try to set a priority to your add_filter function in the functions.php file, like

    add_filter("loop_shop_per page", create_function('$cols', 'return 16'), 20);

    Hope you get it to work.

    Greetings

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

悬赏问题

  • ¥15 怎么实现数组的循环累加,simulink
  • ¥15 51单片机最小开发板系统,想让寻迹小车在全检测到黑线(寻迹模块代码在第一块板子上)时蜂鸣器响(在第二块板子上)
  • ¥15 pbootcms多选调用成列表
  • ¥15 51单片机oled显示时钟
  • ¥15 小规模TSP问题的动态规划求解
  • ¥25 kubelet.service: Failed with result 'exit-code'.
  • ¥15 bitvise黑框内一键部署v2ray提示账户没有root怎么解决
  • ¥15 车型识别以及相似度匹配中细节特征提取以及图像模糊问题
  • ¥15 怎么用鸿蒙的ArkTs写出来啊
  • ¥30 websocket服务端多线程通信
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部