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;
}

view raw

functions.php

hosted with ❤ by GitHub


Posted

in

by

Tags:

Comments

One response to “WooCommerce 3.3 – Hide uncategorized category from the shop page on the frontend”

  1. […] and activate. No configuration required. If you're more into writing code snippets yourself, here is the snippet the plugin is based off […]

%d bloggers like this: