I’m creating a theme and don’t want to display the sidebar on single-product’s page.
Following the recommendations of WooCommerce, I made a copy of “templates” folder (under woocommerce plugin) and installed on mytheme/templates, changing the folder’s name to “woocommerce“. On my theme’s root, I created a file called sidebar-shop.php.
By now I have the sidebar displayed on the shop page and on the single-product page. I tried to remove do_action('woocommerce_sidebar');
from woocommerce/single-product.php and also tried to create a conditional on woocomerce/shop/sidebar.php, something like:
if (!is_page('single-product') {
get_sidebar('shop');
}
but the sidebar remains.
Is there a working option to remove only the single product sidebar?
The conditional tag for single products is is_product()
You may also want to change the layout on that product page to full width to remove the gap and reduce the width of the content area using a custom body class which you can also generate conditionally.
Woo Commerce conditional tags http://docs.woothemes.com/document/conditional-tags/
Here it goes..
It works with latest woocommerce 2.5.2
Also CSS needed: