Add a WooCommerce Sidebar with Genesis Simple Sidebars

Here is how to add a separate sidebar for WooCommerce pages using Genesis Simple Sidebars.

One of the ways to make WooCommerce and Genesis play nicely is using a plugin called  Genesis Connect for WooCommerce , but users are having issues with its code and from my own experience it is troublesome if also using Genesis Simple Sidebars, which we will use to create our extra WooCommerce sidebar.

So we will make Genesis and WooCommerce compatible without a plugin

Connecting Genesis and WooCommerce

In your functions.php declare WooCommerce support

<?php //<~ don't add in
// Declare WooCommerce support for your theme
add_theme_support( 'woocommerce' );
view raw functions.php hosted with ❤ by GitHub

Then in your theme folder create a new file named woocommerce.php and add :

<?php //<~ do add in
* WooCommerce Template
* Template used for all WooCommerce views in order to avoid using Genesis Connect
* Save this into `themename/woocommerce.php`
//* Add WooCommerce content output
if ( function_exists( 'woocommerce_content' ) ) {
// Remove standard post content output
remove_action( 'genesis_loop', 'genesis_do_loop');
// Replace the default Genesis loop with WooCommerce's
add_action( 'genesis_loop', 'woocommerce_content' );
view raw woocommerce.php hosted with ❤ by GitHub

This is essentially removing replacing the Genesis default loop with the WooCommerce content.

Source and modified source by @pixelyzed


Create a WooCommerce Sidebar with Genesis Simple Sidebars


Self explanatory to set up


Set the Sidebar for WooCommerce Pages Only

Finally in your functions.php you can set a conditional to make the Woo pages use the new sidebar

<?php //<~ don't add in
function themeprefix_remove_default_sidebar() {
if( is_page ( array( 'cart', 'checkout' )) || 'product' == get_post_type() ) {//set which pages
remove_action( 'genesis_sidebar', 'ss_do_sidebar' );
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
add_action( 'genesis_sidebar', 'themeprefix_add_woo_sidebar' );
//Alternative Sidebar
function themeprefix_add_woo_sidebar() {
dynamic_sidebar( 'woocommerce-sidebar' ); //add in the sidebar name
add_action( 'genesis_before_sidebar_widget_area', 'themeprefix_remove_default_sidebar' ); //sets the ball rolling
view raw woosidebar.php hosted with ❤ by GitHub

Similar post  On Genesis Simple Sidebars 

1 Comment

  1. Diana on June 16, 2016 at 10:01 pm

    This is great – thanks.

    I have successfully added a Simple Sidebars to my WooCommerce pages using this. However, I want to remove the sidebar that appears on the other, non-WooCommerce pages. Right now the sidebars are just stacked:

    How do I remove the other sidebar and just keep my simple sidebar?

    Thanks again!

Leave a Comment