Site logo

Archived topic

Shop page no side-bar / product category pages left side-bar

10 replies · Started by one2love on June 2, 2017

Viewing posts 1–11 of 11

I having am trouble finding a filter to make the WooCommerce SHOP base page have NO-SIDEBAR and then have all shop/product archive pages have a LEFT-SIDEBAR?

I currently have a LEFT-SIDEBAR set.

Hi there,

If you turn on our new WooCommerce add-on in GPP 1.3, you can set the sidebar layout in "Customize > Layout > WooCommerce".

Yes, I already did that...the only woocommerce related page that still has a sidebar is the "cart" one, strangely.

The cart page is a regular WordPress page, so the option to change the page sidebar layout applies to it (Customize > Layout > Sidebars).

Hi Tom
I am aware of the new add-on. It is great, thanks.

I already have the sidebar set to left using said extension. The problem lies that I want no sidebar on the shop landing page and left on all other shop related archive pages.

I realise that the shop also uses the default WooCommerce archive template but perhaps there is a trick I am missing - a filter targeting the SHOP landing page specifically?

Thank you

Great, thanks, Tom. That worked perfectly.

Anyone looking for this, this is what I used to have the SHOP page have a no sidebar with all other shop archives set to have a sidebar (which you need to set in your theme settings):

add_filter( 'generate_sidebar_layout','tu_custom_woocommerce_sidebar_layout' );
function tu_custom_woocommerce_sidebar_layout( $layout )
{
 	// If we are on a woocommerce page, set the sidebar
 	if ( function_exists( 'is_woocommerce' ) && is_shop() )
 	 	return 'no-sidebar';

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

 }

Thanks for posting the solution! :)

Worked for me as well, thank you! :)

Awesome! :)

This archived topic is closed to new replies.