Reply To: Right-sidebar and woocommerce subcategoryes

Home Forums Support Right-sidebar and woocommerce subcategoryes Reply To: Right-sidebar and woocommerce subcategoryes

#165958
Tom
Lead Developer
Lead Developer

I think you can use the product_category() conditional: https://docs.woothemes.com/document/conditional-tags/

add_filter( 'generate_sidebar_layout','generate_custom_woocommerce_sidebar_layout' );
function generate_custom_woocommerce_sidebar_layout( $layout )
{
 	// If we are on a woocommerce page, set the sidebar
 	if ( is_woocommerce() )
 	 	return 'both-sidebars';

 	if ( is_product_category( 'shirts' ) )
 	 	return 'no-sidebar';

 	// Or else, set the regular layout
 	return $layout;

 }