Skip to content

Instantly share code, notes, and snippets.

@renrax
Forked from mikejolley/functions.php
Created January 21, 2022 15:01
Show Gist options
  • Save renrax/9e041dde278eacb6c0b1380d6a7c618c to your computer and use it in GitHub Desktop.
Save renrax/9e041dde278eacb6c0b1380d6a7c618c to your computer and use it in GitHub Desktop.
WooCommerce 3.3 - Hide uncategorized category from the shop page on the frontend
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_filter( 'woocommerce_product_subcategories_args', 'custom_woocommerce_product_subcategories_args' );
function custom_woocommerce_product_subcategories_args( $args ) {
$args['exclude'] = get_option( 'default_product_cat' );
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment