Last active
August 29, 2015 14:06
-
-
Save croosen/83ce8a3bc8ee520eb7ba to your computer and use it in GitHub Desktop.
WooCommerce - Show all subcategories in product category / archive pages - even when empty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$args = apply_filters( 'woocommerce_product_subcategories_args', array( | |
'parent' => $parent_id, | |
'menu_order' => 'ASC', | |
'hide_empty' => 0, | |
'hierarchical' => 1, | |
'taxonomy' => 'product_cat', | |
'pad_counts' => 1 | |
) ); | |
// Update: Use this in your functions.php: | |
add_filter('woocommerce_product_subcategories_args', 'woocommerce_show_empty_categories'); | |
function woocommerce_show_empty_categories($args){ | |
$args['hide_empty']=0; | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
Is it possible to HIDE a specific category or subcategory from the whole shop using woocommerce_product_subcategories_args?