Skip to content

Snippet: Custom columns for specific WooCommerce category

// Custom columns for specific WooCommerce category
add_filter( 'wpex_loop_shop_columns', function( $columns ) {
	if ( is_tax( 'product_cat', 'courses' ) ) {
		$columns = 2;
	}
	return $columns;
}, 99 );
All PHP snippets should be added via child theme's functions.php file or via a plugin.
We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top