Aus dem Shop und aus dem Widges. Theme: Storefront
/**functions.php
* Ausblenden einer WooCommerce Kategorie
*/
add_action( 'wp_body_open', 'envo_storefront_skip_link', 5 );
add_filter( 'get_terms', 'exclude_category', 10, 3 );
function exclude_category( $terms, $taxonomies, $args ) {
$new_terms = array();
if ( is_shop() ){
foreach ( $terms as $key => $term ) {
if( is_object ( $term ) ) {
if ( 'elektrogeraete' == $term->slug && $term->taxonomy = 'product_cat' ) {
unset($terms[$key]);
}
}
}
}
return $terms;
}
/*und aus dem Kategorie Widges*/
add_filter( 'woocommerce_product_categories_widget_args', 'woo_product_cat_widget_args' );
function woo_product_cat_widget_args( $cat_args ) {
$cat_args['exclude'] = array('454');
return $cat_args;
}