Woocommmerce disabling sidebar on single product page
-
I want to disable sidebar completely from single product page and make the page full width.
I have read and tried each and every document available on this but to no gain
1. Copied the following code to functions.php
function remove_sidebar_shop() { if ( is_product() ) { remove_action('woocommerce_sidebar','woocommerce_get_sidebar'); echo("Test if"); } else { echo("Test else"); } } add_action('get_header','remove_sidebar_shop');
(the echo parts were for debugging)
2. Commented the get_sidebar(); part from archive-product.php after copying it to my-theme/woocommerce.
3. Commented the get_sidebar(); part from single-product.php after copying it to my-theme/woocommerce.
4. Commented the whole sidebar.php file.But nothing seems to work.
Please help as i am a newbee to wordpress and php.
Thanks in advance..
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Woocommmerce disabling sidebar on single product page’ is closed to new replies.