Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Make WooThemes Storefront product pages full width
add_action( 'get_header', 'remove_storefront_sidebar' );
if ( is_product() ) {
remove_action( 'storefront_sidebar', 'storefront_get_sidebar', 10 );
}
}
@sjoerdfaerber

This comment has been minimized.

Copy link

commented Nov 9, 2015

You forgot to put in a function:

add_action( 'get_header', 'remove_storefront_sidebar' );
function remove_storefront_sidebar(){
if ( is_product() or is_product_category() ) {
remove_action( 'storefront_sidebar', 'storefront_get_sidebar', 10 );

}

}

@chrisbfi

This comment has been minimized.

Copy link

commented Nov 10, 2015

Snap, I just found the same as sjoerdfaerber

function remove_storefront_sidebar() {
    if ( is_product() ) {
            remove_action( 'storefront_sidebar', 'storefront_get_sidebar', 10 );
    }
}
add_action( 'get_header', 'remove_storefront_sidebar' );
@srdco

This comment has been minimized.

Copy link

commented Feb 4, 2017

Updated gist (also adds a variation to use to force ALL pages fullwidth):
https://gist.github.com/srdco/fa852ebe33bde0e42d7e5834ac7ca61a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.