How can I use a hook to add a parameter into the woocommerce shop loop?


I’m working with a woocommerce site.
The shop page on the site does what one would expect: it simply outputs a list of all products.

I want to exclude products with a certain category.

I don’t have the option of over-riding a template. So I’ll have to use a hook or a filter.

So far I’ve figured out that I can use the is_shop conditional to only affect the loop on the shop page. And I can use the ‘category__not_in’ parameter to exclude posts from a loop.

This leaves me with one puzzle: how do I actually inject my own query parameter into the product loop?

bob.dobbs 4 months 0 Answers 17 views 0

Leave an answer