Skip to main content

Timeline for Can't remove woocommerce sidebar

Current License: CC BY-SA 4.0

15 events
when toggle format what by license comment
Jun 9, 2018 at 13:19 history edited Bjorn CC BY-SA 4.0
deleted 6 characters in body
Jun 9, 2018 at 10:55 vote accept wpdev
Jun 9, 2018 at 10:55 comment added wpdev Ok i will use woocommerce conditional tags. Thank you so much.
Jun 9, 2018 at 10:33 comment added Bjorn After creating the page-cart.php template, did you go to the cart page and select that template @ Page Attributes? Without that last step it won't work. Also, in your default theme template you can do a if(! is_cart()) before you load the sidebar. Make sure that you check if WOO is active before you call Woo specific functions. That way you don't need a special page-cart.php template.
Jun 9, 2018 at 10:03 comment added wpdev Ok it will work i know. But can you explain me why page-cart.php method not work? (Edited my question)
Jun 9, 2018 at 9:59 comment added Bjorn See my updated answer.
Jun 9, 2018 at 9:57 history edited Bjorn CC BY-SA 4.0
added 235 characters in body
Jun 9, 2018 at 9:51 comment added wpdev It created by wordrpress default. And located in page.php. If i remove get_sidebar in page.php it is removing in cart page too. So i created page-cart.php for special editing. But changes are not applying to cart page.
Jun 9, 2018 at 9:46 comment added Bjorn Well that's kinda hard without knowing how you setup everything. Do you override the Woo cart template inside your theme? Does your theme default has a sidebar? Can't you create a no-sidebar template inside your theme?
Jun 9, 2018 at 9:30 comment added Bjorn Like i said: do_action( 'woocommerce_sidebar' ) does exist in the singe-product.php template. that's why your remove_action() is working for single products. If the cart sidebar is not generated by WOO, you'll have to find who/what is creating it.
Jun 9, 2018 at 8:45 comment added wpdev It not generated by Woocommerce. I tried remove get_sidebar() from page.php it removed from cart page too. But i wonder, why 'remove_action' working for single-product and not working for cart page.
Jun 9, 2018 at 8:37 comment added Bjorn See my updated answer
Jun 9, 2018 at 8:37 history edited Bjorn CC BY-SA 4.0
added 225 characters in body
Jun 9, 2018 at 8:09 comment added wpdev I am developing a new theme. And i tried 'wp_head' and 'init'
Jun 9, 2018 at 7:49 history answered Bjorn CC BY-SA 4.0