vendredi 10 juin 2016

Removing sidebar from single product page in FACTORY wp theme

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:

  1. 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)

  1. Commented the get_sidebar(); part from archive-product.php after copying it to my-theme/woocommerce.

  2. Commented the get_sidebar(); part from single-product.php after copying it to my-theme/woocommerce.

  3. Commented the whole sidebar.php file.

But nothing seems to work.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire