Storefront Theme – Remove WooCommerce Sidebar on the Single Product Page
/**
* @snippet Remove Sidebar @ Single Product Page for Storefront Theme
* @how-to Get tutoraspire.com FREE
* @sourcecode https://tutoraspire.com/?p=19572
* @author Tutor Aspire
* @testedwith WooCommerce 3.2.6
*/
add_action( 'get_header', 'tutoraspire_remove_storefront_sidebar' );
function tutoraspire_remove_storefront_sidebar() {
if ( is_product() ) {
remove_action( 'storefront_sidebar', 'storefront_get_sidebar', 10 );
}
}
Divi Theme – Remove WooCommerce Sidebar on the Single Product Page
This will not need any coding. Divi theme already removes the WooCommerce sidebar in their function and adds back the default Divi sidebar.
To remove the sidebar from products, go to Product > Edit and from the right sidebar select “Page Layout > Full Width”:
Divi & WooCommerce: remove the sidebar on the single product page
If you also would like to remove the Divi sidebar from the archive pages, go to Divi > Theme Options > General Settings and set the “Shop Page & Category Page Layout for WooCommerce” to “Full Width”:
Divi & WooCommerce: remove sidebar on archive pages