Website Building » WooCommerce » How Do I Get Rid of the Sidebar in WooCommerce Product Page Divi?

How Do I Get Rid of the Sidebar in WooCommerce Product Page Divi?

Last updated on October 1, 2022 @ 10:26 pm

If you’re using WooCommerce with the Divi Theme, you may have noticed that the product pages have a sidebar by default. While this can be useful for some stores, others may want to get rid of it to create a more streamlined look. Here’s how to do it.

The first thing you’ll need to do is create a new WooCommerce template file called product-fullwidth.php. You can do this by copying the existing product.php file from the Divi Theme folder and renaming it. Once you’ve done that, open up the new file and delete the following line of code:

This will remove the sidebar from the product page. Next, you’ll need to tell WooCommerce to use this new template file. You can do this by adding the following code to your functions.php file:

function my_theme_add_woocommerce_support() {
add_theme_support( 'woocommerce', array( 'product_grid' => array( 'default_rows' => 3, 'min_columns' => 1, 'max_columns' => 6, ), ) ); }
add_action( 'after_setup_theme', 'my_theme_add_woocommerce_support' );

PRO TIP: Please be aware that the “How Do I Get Rid of the Sidebar in WooCommerce Product Page Divi?” article is outdated and no longer accurate. The information in this article may lead to unexpected results.

function wc_template_path() { return get_template_directory() . '/'; }
function wc_template_path() { return get('/divi/divi-child/'); }

Conclusion:

removing the sidebar from the WooCommerce product page in Divi is relatively easy. Simply create a new template file called product-fullwidth.php and delete the line of code that calls for the sidebar. Then, add some code to your functions.php file to tell WooCommerce to use this new template.

Morgan Bash

Morgan Bash

Technology enthusiast and Co-Founder of Women Coders SF.