wordpress Woocommerce 显示每个类别及其产品

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12330857/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:00:14  来源:igfitidea点击:

Woocommerce show each categories with their products

wordpresswoocommerce

提问by DharmaRaj Rathod

I can go to 'WooCommerce -> Settings' link from side bar admin menu & select 'Catalog' tab & then tick 2 check boxes "Show subcategories on the shop page" But this shows a list of categories, then all products. What i want is on shop page, At first category title, then its products under it, then next category and its products.

我可以从侧边栏管理菜单转到“WooCommerce -> 设置”链接并选择“目录”选项卡,然后勾选 2 个复选框“在商店页面上显示子类别”但这会显示类别列表,然后是所有产品。我想要的是在商店页面上,首先是类别标题,然后是其下的产品,然后是下一个类别及其产品。

In short, i want to list all products category wise.

简而言之,我想明智地列出所有产品类别。

回答by Tomanow

You could create a new shop page and use the woocommerce shortcodes in combination with headers to create a list of products organized by category. For example, in the HTML editor you could do something like this:

您可以创建一个新的商店页面,并将 woocommerce 短代码与标题结合使用来创建按类别组织的产品列表。例如,在 HTML 编辑器中,您可以执行以下操作:

<h2>Category Name</h2>
[product_category category="category-name" per_page="12" columns="4" orderby="date" order="desc"]