Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'woocommerce_product_query', 'custom_remove_category_from_sale_page',99 );
- function custom_remove_category_from_sale_page($q){
- global $wp_query;
- if($wp_query->is_sale_page) {
- $taxquery = $q->get( 'tax_query' );
- if ( ! is_array( $taxquery ) ) {
- $taxquery = array();
- }
- $taxquery []=
- array(
- 'taxonomy' => 'product_cat',
- 'field' => 'term_id',
- 'terms' => array( 12 ),
- 'operator'=> 'NOT IN'
- );
- $q->set( 'tax_query', $taxquery );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement