More woocommerce support

Home Forums Support More woocommerce support

Home Forums Support More woocommerce support

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #198968
    Luiz Bills

    Add 2 Sidebars (when woocommerce is active):

    • on single product page
    • on product list (archive) page
    #199073
    Tom
    Lead Developer
    Lead Developer
    #199232
    mc208

    Tom, I see that GP has two sidebars, a left and right. Is it possible to make the right sidebar my blog sidebar and the left sidebar only appear on woocommerce pages? If so, how would that be done? Then I could get away without having to use a sidebars plugin. Just make it simple, blog sidebar on right, shopping sidebar on left.

    #199272
    Luiz Bills

    Tom

    Thanks, I’ll try these plugins.

    • This reply was modified 7 years, 10 months ago by Tom.
    #199281
    Tom
    Lead Developer
    Lead Developer

    Michael – you could do something like this:

    add_filter( 'generate_sidebar_layout','generate_custom_woocommerce_sidebar_layout' );
    function generate_custom_woocommerce_sidebar_layout( $layout )
    {
     	// If we are on a woocommerce page, set the sidebar
     	if ( is_woocommerce() )
     	 	return 'left-sidebar';
    
     	// Or else, set the regular layout
     	return $layout;
    
    }

    Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

    #200097
    mc208

    Tom, it worked! Saved me from having to use another plugin Thank you! ๐Ÿ™‚

    #200126
    Tom
    Lead Developer
    Lead Developer

    You’re welcome ๐Ÿ™‚

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.