Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter("woocommerce_product_query_tax_query", "hwn_hide_shop_categories");
- function hwn_hide_shop_categories($tquery) {
- $hidden_categories = array("tshirts", "hoodies");
- if (is_shop()) {
- $tquery[] =
- array(
- "taxonomy" => "product_cat",
- "terms" => $hidden_categories,
- "field" => "slug",
- "operator" => "NOT IN"
- );
- }
- return $tquery;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement