Hide function only on main shop page?
-
Hello.
I want to add a specific function using this action:
add_action('woocommerce_before_shop_loop', 'get_current_product_category');
However, I want to hide it on https://mydomain.com/shop but to be able to show it on https://mydomain.com/shop/category OR https://mydomain.com/product etc. Is this possible?
As far as I know,
is_shop()
applies to all pages so it doesn’t work for me.I’ve tried
if(is_product_category() || is_archive()) {my_code_here}
but this doesn’t work
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Hide function only on main shop page?’ is closed to new replies.