Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove the Sidebar form your WooCommerce & Genesis WordPress Shop
<?php
/*
* This will remove the Genesis sidebar from your WooCommerce category, taxonomy and product pages
* Just add it to your functions.php in your child theme.
*/
function remove_sidebar_shop() {
if(is_product_category() || is_product_tag() || is_product()) {
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
}
}
add_action('template_redirect', 'remove_sidebar_shop');
@genx777

This comment has been minimized.

Copy link

genx777 commented Jan 30, 2018

Worked perfectly. Thanks so much! I was missing a key component to resolving this, and your contribution resolved that!

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.