Skip to content

Instantly share code, notes, and snippets.

@jamiemarsland
Created February 18, 2015 05:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jamiemarsland/3835778210966604defa to your computer and use it in GitHub Desktop.
Save jamiemarsland/3835778210966604defa to your computer and use it in GitHub Desktop.
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
Copy link

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
Copy link

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
Copy link

srdco 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