Any way to display WC Product Categories with Loopers?

Seems that there is an “All Terms” Looper I can use, but I only want to display parent categories, on the homepage for example.

Furthermore, how would I also be able to display only subcategories?

Is there any way to do this out of the box without custom coding? Doesn’t appear Query Builder can do this.
In fact, there doesn’t seem to be -any- simple way to do this. Kinda surprised as this seems to be something that should be pretty basic.

Please advise - thanks!

Hello @cjavier,

Thanks for writing to us.

To display the Product category with the Looper you need to set the Looper Provider as All Terms and set the Taxonomy as Product Category.

Test-Page-Builder-Pro (15)

After that, you can use dynamic content to display the Product category title.
For title {{dc:term:name}}
For Link {{dc:term:url}}

Hope it helps
Thanks

1 Like

Right that’s what I mentioned I did, but what that does is show me ALL categories. Not what I’m looking to do.

What I want to do is show ONLY PARENT PRODUCT CATEGORIES.

And furthermore, how would I be able to show CHILD PRODUCT CATEGORIES for certain parents?

Hi @cjavier,

To show the WooCommerce categories you may need to add custom looper functions as described in the following thread. I would suggest you go through the following thread and let us know if you have any further doubt on it.


Hope it helps.
Thanks

Thanks for the info.

It appears that these solutions will show subcategories in a parent category layout.

Would it be possible to show parent categories only on a standard content page like the homepage?
This is more along the lines of what I’m trying to achieve.

Thanks!

1 Like

Hello @cjavier,

You will need to use the Custom Looper Provider and then check out this old thread:

Best Regards.

Saw this thread already and overlooked the comment on this code and didn’t realize you can change to parent:

/**
 * Filter for home page. use 'child_of' to display full depth. use 'parent' to display only first level.
 *
 */

I’ll give this a shot - thanks so much for referencing the thread for me.

Hi @cjavier,

You’re welcome! If you have any other concerns or clarifications regarding our theme features, feel free to open up a new thread.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.