I am using storefront theme, where there is options for the Full Width in the pages but not in the Product Page and Product Category Page in the Store Front Theme

As i played with css and i go this line in the template

<div id="primary" class="content-area">

As i removed the content-area class i can able to remove the space of the sidebar, but that is not what i was expected, because it is removing sidebar in whole website

I need to remove it only in product page but not in product-category page, how this can be achieved in the storefront theme

2 Answers
2

for product page, you can put in functions.php

function remove_storefront_sidebar() {
    if ( is_product() ) {
    remove_action( 'storefront_sidebar', 'storefront_get_sidebar', 10 );
    }
}
add_action( 'get_header', 'remove_storefront_sidebar' );

It works with latest woocommerce 2.5.2
Also CSS is needed:

.single-product.right-sidebar .content-area {
  float: none;
  margin-right: 0;
  width: 100%;
}

Leave a Reply

Your email address will not be published. Required fields are marked *