Skip to content
Advertisement

Hot to add subcategories under category element in woocommerce flatsome theme WordPress

I’m trying to set up e-commerce website. Ran into a problem with Categories element. I want the element to represent not only categories, but also subcategories below itself.

I also cannot edit page without UX builder, I think that’s because Flatsome theme elements.

I want something like that :

Category_1 Category_2

Subcat1.1 ___Subcat2.1

Subcat1.2 ___Subcat2.2

Like that:

My example in image

But, currently I can put categories only. Cannot insert subcategories below. Cannot change Category element.

Currently tried few examples here on stack, using php scripts, but failed.

I ask you for your help, because I don’t now where to seek for info I need.

Is it even possible with given circumstances? Or I need to create whole Page without Flatsome, and then add custom element?

Advertisement

Answer

Here is the code to get parent and child category.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement