Site logo

Archived topic

Any way to disable elements and sidebar for all WooCommerce product pages?

7 replies · Started by Shaun on May 20, 2018

Viewing posts 1–8 of 8

Hi guys, I've got approximately 100 WooCommerce products that I'll be importing soon. Is there any way I can mass disable the sidebar and certain elements (e.g. page header) from the individual product pages? Thanks in advance.

Thanks Leo! I managed to get rid of the sidebar for the products' pages.

I also want to specifically disable the Top Bar for these pages. Is there a way to do it en masse?

Try this snippet:

add_action( 'wp', 'lh_disable_woo_topbar' );
function lh_disable_woo_topbar() {
  if ( is_woocommerce() ) {
    remove_action( 'generate_before_header','generate_top_bar', 5 );
  }
}

Thanks Leo. Do I just copy and paste this into Simple CSS?

Awesome! Thanks Tom and Leo. The code works like a charm!

You're welcome :)

This archived topic is closed to new replies.