dongren4147 2018-06-28 10:28
浏览 74

在父类别页面上显示woocommerce子类别

I am trying to display all of the child product categories, while the parent category page is selected.

At the moment, within the wordpress customiser settings I have the 'Shop page display' to show categories, and the 'Category display' to show subcategories.

When I select the store page, I am presented with the list of categories - lets say one of them is music... great! When I then select music, I would expect to see a set of new child categories, such as Rock, Dance, Pop ect. However at the moment I am just presented with all of the individual products.

How to fix this?

  • 写回答

1条回答 默认 最新

  • dpeqsfx5186 2018-06-28 11:17
    关注

    You can make your own category template.

    The file should be taxonomy-product_cat.php Also look at the archive-product.php

    Your custom code should go around the woocommerce_product_loop_start

    Also check the woocommerce codex


    And to show categories on shop page -

    It's easy, just go to 'WooCommerce -> Settings' link from side bar admin menu & select 'Catalog' tab & then tick 2 check boxes "Show subcategories on the shop page" & "When showing subcategories, hide product" -> click 'Save Changes' button at bottom. That's it! You are Done!

    Now visit 'Shop' page you'll be able to see categories.

    Hope this helps.

    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序