My question is, how can i remove the sidebar only for particular Product category "Slug" and not for its child slugs.
If the url is like below - remove the side bar and make the page full width only for slugs "sanitaryware" and "closets"
http://www.example.com/product-category/sanitaryware/
http://www.example.com/product-category/sanitaryware/closets/
I dont want to remove the sidebar for all "Product Category" reason, i want the side bar to show up the grand-child slug"one-piece-closets":
http://www.example.com/product-category/sanitaryware/closets/one-piece-closets
Code: that i am using in function.php - this is removing the side bar in all the product categories of the website.
<?php
/**
* woocommerce_sidebar hook
*
* @hooked woocommerce_get_sidebar - 10
*/
if (!is_product_category('sanitaryware')){
do_action('storefront_sidebar');
}
?>