I want to disable the sidebar completely from WooCommerce single product page, and make the page full width.
I have read and tried each and every document available but to nothing is available.
Steps:
-
Copied the following code to functions.php
function remove_sidebar_shop() { if ( is_product() ) { remove_action('woocommerce_sidebar','woocommerce_get_sidebar'); echo("Test if"); } else { echo("Test else"); } } add_action('get_header','remove_sidebar_shop');
(the echo parts were for debugging)
-
Commented the
get_sidebar();
part fromarchive-product.php
after copying it tomy-theme/woocommerce
. -
Commented the
get_sidebar()
; part fromsingle-product.php
after copying it tomy-theme/woocommerce
. -
Commented the whole
sidebar.php
file.
But nothing seems to work.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire