• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Remove Sidebar on WooCommerce Pages

This tutorial provides 2 ways to remove the sidebar from any type of WooCommerce page in Genesis child themes.

1. You can change the Layout Settings on Edit Product pages and select the full width layout like this:

or

2. Use code with the is_product() or is_singular( 'product' ) ) conditional tag.

Make sure you have the Genesis WooCommerce Connect plugin activated.

Here’s the code to remove the sidebar from all WooCommerce product pages:

add_filter( 'genesis_pre_get_option_site_layout', 'full_width_layout_product_pages' );
function full_width_layout_product_pages( $opt ) {
if ( is_product() ) {
    $opt = 'full-width-content'; 
    return $opt;
    } 
}

To remove the sidebar from other WooCommerce pages, swap out the is_product conditional tag with any other WooCommerce conditional tag like this :

add_filter( 'genesis_site_layout', 'woocommerce_page_layout' );
function woocommerce_page_layout() {
    if ( is_page ( array( 'cart', 'checkout' )) || is_shop() || 'product' == get_post_type() || is_woocommerce() ) {
        return 'full-width-content';
    }
}

Layout WooCommerce

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.