Archived topic
More woocommerce support
6 replies · Started by Anonymous on June 2, 2016
Add 2 Sidebars (when woocommerce is active):
- on single product page
- on product list (archive) page
Plugins like this won't do what you're wanting?:
https://en-ca.wordpress.org/plugins/display-widgets/
https://en-ca.wordpress.org/plugins/custom-sidebars/
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.
Tom
Thanks, I'll try these plugins.
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/
Tom, it worked! Saved me from having to use another plugin Thank you! :-)
You're welcome :)
