please click here for more wordpress cource
To remove the sidebar from the WooCommerce product page, you will need to make some changes to the template files or use a plugin. Here are the steps you can follow:
Option 1: Use a plugin
- Install and activate a plugin such as “WooCommerce Sidebar Removal” or “Remove WooCommerce Sidebar”.
- Go to the plugin’s settings page and choose the product page where you want to remove the sidebar.
- Save your changes, and the sidebar should be removed from the selected product page.
Option 2: Remove the sidebar manually
- Create a child theme for your WordPress site if you haven’t already done so.
- In the child theme, create a copy of the
content-single-product.php
file from the WooCommerce plugin. - Open the copied file in a text editor.
- Look for the following code:
<div class="col2-set">
<div class="col-1">
<?php
/**
* woocommerce_single_product_summary hook
*
* @hooked woocommerce_template_single_title - 5
* @hooked woocommerce_template_single_rating - 10
* @hooked woocommerce_template_single_price - 10
* @hooked woocommerce_template_single_excerpt - 20
* @hooked woocommerce_template_single_add_to_cart - 30
* @hooked woocommerce_template_single_meta - 40
* @hooked woocommerce_template_single_sharing - 50
* @hooked WC_Structured_Data::generate_product_data() - 60
*/
do_action( 'woocommerce_single_product_summary' );
?>
</div>
<div class="col-2">
<?php do_action( 'woocommerce_sidebar' ); ?>
</div>
</div>
Delete the div
element with the class col-2
, which contains the sidebar. The code should now look like this:
<div class="col2-set">
<div class="col-1">
<?php
/**
* woocommerce_single_product_summary hook
*
* @hooked woocommerce_template_single_title - 5
* @hooked woocommerce_template_single_rating - 10
* @hooked woocommerce_template_single_price - 10
* @hooked woocommerce_template_single_excerpt - 20
* @hooked woocommerce_template_single_add_to_cart - 30
* @hooked woocommerce_template_single_meta - 40
* @hooked woocommerce_template_single_sharing - 50
* @hooked WC_Structured_Data::generate_product_data() - 60
*/
do_action( 'woocommerce_single_product_summary' );
?>
</div>
</div>
- Save the file and upload it to your child theme directory.
- Refresh your product page, and the sidebar should be removed.