categories - Best way of getting WooCommerce category path

If I am on a product or any categorysubcategory I want to display a complete path to the topmost category.Does WooComm

If I am on a product or any category/subcategory I want to display a complete path to the topmost category. Does WooCommerce already have a function for it or do I need to make my own loop that goes from child to parent? Should I use $wp_query->get_queried_object()? What is the best code for it?

Example:

If I am on a product or any category/subcategory I want to display a complete path to the topmost category. Does WooCommerce already have a function for it or do I need to make my own loop that goes from child to parent? Should I use $wp_query->get_queried_object()? What is the best code for it?

Example:

Share Improve this question asked Feb 9, 2020 at 6:00 Hrvoje BatrnekHrvoje Batrnek 1134 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I think you may look for breadcrumb? Can you try it?

<?php woocommerce_breadcrumb(); ?>

This link may help: https://docs.woocommerce/document/woocommerce_breadcrumb/

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744763247a4592298.html

相关推荐

  • categories - Best way of getting WooCommerce category path

    If I am on a product or any categorysubcategory I want to display a complete path to the topmost category.Does WooComm

    18小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信