Removing sidebar on product page

Hi,

In order to remove the sidebar on the product pages, i tried that:
"
Hello there,

Thank you for asking.

In order to achieve that objective, you should need to remove an action hook which register the sidebar in the WooCommerce page. It can be passed through the functions.php file in child theme mode.

Download and activate the Sydney Pro child theme 11
Open the sydney-child/functions.php file. Then, add the following code at the most bottom

remove_action( ‘woocommerce_sidebar’, ‘woocommerce_get_sidebar’, 10 );

Open the sydney-child/style.css file. Then, add the following CSS code

.woocommerce-page #primary.col-md-9{
width: 100%;
float: none;
}

Upload the changes through FTP or cPanel

Let me know how it goes. I’ll wait to hear back from you regarding your stats.

Warmest regards,
Kharis"

I kinda worked, however the sidebar is now at the bottom of the page. Can you tell me how to remove it totally ?

Thanks,
Victor

Hello Victor,

The simplest solution is to use this function and add it with Code Snippets plugin.

    add_action('init', 'sydney_child_remove_shop_sidebar');
    function sydney_child_remove_shop_sidebar() {
      remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
    }

Then you’d need to add the below CSS code to expand the products container full width.

    .woocommerce-page #primary.content-area {
      width: 100%;
    }

Add it to Appearance > Customize > Additional CSS from dashboard.

Regards,
Kharis

works perfectly thank you Kharis !

You’re welcome!

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis