Woocommerce mağazanızda bazı kategorideki ürünleri mağaza sayfasında göstermek istemiyorsanız tema funtions.php dosyasına ekleyeceğiniz bu kod ile rahatça uygulayabilirsiniz. “Sebzeler” ve “Meyveler” yazan yerleri kendi mağazanıza göre düzenleyiniz.
add_action( 'pre_get_posts', 'remove_cat_from_shop_loop' ); function remove_cat_from_shop_loop( $q ) { if ( ! $q->is_main_query() ) return; if ( ! $q->is_post_type_archive() ) return; if ( ! is_admin() && is_shop() ) { $q->set( 'tax_query', array(array( 'taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => array( 'Sebzeler', 'Meyveler'), // Kendi mağazanıza göre düzenleyiniz. 'operator' => 'NOT IN' ))); } remove_action( 'pre_get_posts', 'remove_cat_from_shop_loop' ); }