Skip to content

Instantly share code, notes, and snippets.

@terriann
Created August 14, 2015 11:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save terriann/ad8474eafcf686615705 to your computer and use it in GitHub Desktop.
Save terriann/ad8474eafcf686615705 to your computer and use it in GitHub Desktop.
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
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