Skip to content

Instantly share code, notes, and snippets.

Avatar

Kartik Parmar kartikparmar

  • Mumbai
View GitHub Profile
@kartikparmar
kartikparmar / functions.php
Created Sep 11, 2019
Removing products from a particular category on the shop page.
View functions.php
<?php
function hpcs_hide_products_category_shop( $query ) {
$tax_query = (array) $query->get( 'tax_query' );
$tax_query[] = array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => array( 'chairs' ), // Category slug here