• Resolved davemktg86

    (@davemktg86)


    Hi,

    I’m writing a new topic about this problem because in the previous one there aren’t plugin author answer. Is it possible to have on free version the possibility to hide the uncategorized category. It doesn’t seem me to ask for the moon. How can we do it? (not via css)

    thank you very much

    best regards

Viewing 1 replies (of 1 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi,
    Try to add this custom code in your functions.php

    if( !function_exists( 'ywcca_add_product_categories_args')) {
    	add_filter( 'ywcca_wc_product_categories_widget_args', 'ywcca_add_product_categories_args', 10, 1 );
    
    	function ywcca_add_product_categories_args( $args ) {
    
    		$uncategorized = get_categories( array( 'taxonomy' => 'product_cat', 'slug' => 'uncategorized' ) );
    
    		if ( $uncategorized ) {
    
    			$excluded_id = array();
    
    			foreach ( $uncategorized as $category ) {
    				$excluded_id[] = $category->term_id;
    			}
    			$args['exclude'] = $excluded_id;
    		}
    
    		return $args;
    	}
    }
Viewing 1 replies (of 1 total)

The topic ‘Hide uncategorized category’ is closed to new replies.