Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    To show the sub-categories of a parent category. You can do it by replacing the “ID” value in the parent parameter with the ID of the parent category of the subcategories you would like to show.

    [product_categories number="0" parent="ID"]

    To get the category ID, go to the category page, and edit it, and you will see the ID in the URL:

    If I misunderstood something, let me know.

    Thread Starter sigrundish

    (@sigrundish)

    So it is not possible to do it directly in the Divi Builder? I will need to create a custom function that gets the ID somehow (I am not using the ID in the URL of the category pages), and use a hook to use the feature dynamically? I am not going to hard-code the ID to every single category page.

    Hi,

    I understand your point.

    I’m afraid, I’m not fully familiar with Divi, I’d suggest getting in touch with the Divi support, you can contact them right here.

    Since this is a development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out with this request.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    As well as the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. Many developers use those forums, you can get in touch with one of them to help you further with this request.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show subcategories on a category page using short code’ is closed to new replies.