Site logo

Archived topic

Adding a sidebar to Home Page - which is Woocemmerce Shop

3 replies · Started by Raymond on October 9, 2017

Viewing posts 1–4 of 4

Hello,

I'm trying to add a sidebar to my home page which is the woocommerce Shop page. After trying all of the methods below, then going to Customize/Widgets the Sidebar does not display.

Please advise, thank you!

I have tried the following:
Setting the Sidebar Layout to: Content/Sidebar;

Adding the text below by using:
Code Snippets;
Adding directly to Parent via Customize/Aditional CSS;
Adding to Child Theme/GeneratePress Child: Stylesheet (style.css)

add_filter( 'generate_sidebar_layout','tu_custom_woocommerce_sidebar_layout' );
function tu_custom_woocommerce_sidebar_layout( $layout )
{
// If we are on a woocommerce page, set the sidebar
if ( function_exists( 'is_woocommerce' ) && is_woocommerce() )
return 'both-left';

// Or else, set the regular layout
return $layout;

}

Hi there,

No need for the function if you're using the WooCommerce add-on. You can set the sidebar layout in Customize > Layout > WooCommerce.

Let me know if you need more info :)

Too easy, Thanks!

You're welcome :)

This archived topic is closed to new replies.