woocommerce显示类别/子类别/产品 [英] woocommerce display categories/subcategories/products

查看:446
本文介绍了woocommerce显示类别/子类别/产品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在woocommerce中,有没有办法显示带有子类别及其产品的主要类别? PHP或短代码? 我尝试了一些条件格式,但是什么也没做.

is there any way to display the main categories with subcategories and their products in woocommerce? php or shortcode? I've tried with some conditional formatting,but nothing.

推荐答案

您有两个默认的短代码可用于显示产品类别(已定义了特定的父类别,以显示子类别)和特定类别中包含的产品.

You have two default shortcodes available to display both, product categories (with a specific parent category defined, to display subcategories,) and products contained inside a specific category.

要显示顶级类别,请使用简码:

To display top-level categories use the shortcode:

[product_categories parent="0"]

如果要显示子类别,请在父属性中包括类别ID.

If you want to display subcategories, include the category ID inside the parent attribute.

要显示类别内的产品:

[product_category category="category-slug-here"]

此简码的完整参考:产品类别简码和<一个href ="http://docs.woothemes.com/document/woocommerce-shortcodes/#section-8" rel ="nofollow">类别为简码的产品

Full reference for this shortcodes: product categories shortcode and products in category shortcode

这篇关于woocommerce显示类别/子类别/产品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆