- This topic has 17 replies, 1 voice, and was last updated 2 years, 9 months ago by Gregor.
-
AuthorPosts
-
August 13, 2015 at 2:03 am #128885stardrive
Dear Tom,
The Woocommerce Shop page sidebar is now permanently showing the right sidebar. Even when I set the Sidebar Layout in the /shop page to Sidebar/Content or Content (no sidebars), the shop front end display will still be content/sidebar.
Please, kindly assist.
Regards,
Stardrive
August 13, 2015 at 8:57 am #128948TomLead DeveloperLead DeveloperHi there,
WordPress sees the WooCommerce index as the blog page, so the blog layout controls the layout for that page.
You can use a function to set the WooCommerce sidebar to whatever you want: https://generatepress.com/knowledgebase/choosing-sidebar-layouts/#sidebar-filter
Let me know if you need more info π
August 13, 2015 at 9:39 am #128955stardriveDear Tom,
Please, I used the function below to change the sidebar to left sidebar in all woocommerce category pages. But, it is not working: It is still the right sidebar that is showing in the default shop page and in all category pages
add_filter( ‘generate_sidebar_layout’,’generate_custom_category_sidebar_layout’ );
function generate_custom_category_sidebar_layout( $layout )
{
// If we are on a category, set the sidebar
if ( is_category() )
return ‘left-sidebar’;// Or else, set the regular layout
return $layout;}
Regards,
Stardrive
August 13, 2015 at 9:40 am #128956TomLead DeveloperLead DeveloperThat’s for categories.
You’re looking for this function:
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 'both-left'; // Or else, set the regular layout return $layout; }
August 13, 2015 at 10:02 am #128965stardriveDear Tom,
What I actually want is to have the left sidebar show in woocommerce product category pages while the blog right sidebar show in woocommerce single product detail page.
The blog right sidebar is showing in woocommerce single product detail page, which is OK.
But, the blog right sidebar is also showing in woocommerce product category pages, which is not OK; and this is not what i want for woocommerce product category pages. So, I am having issue with the woocommerce product category pages.
Best Regards,
Stardrive
August 13, 2015 at 10:28 am #128984TomLead DeveloperLead DeveloperIn that case, this code should work:
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; }
That should set the left sidebar for any WooCommerce pages, excluding the single product pages.
August 13, 2015 at 11:21 am #128990stardriveDear Tom,
Please, the function did not work. It set the left sidebar for any WooCommerce pages, and including the single product pages.
Regards,
Stardrive
NB:
Sorry for the delayed response. I was communicating with the woocommerce plugin author on the issue with product variation. He found out that Magic Zoom plugin is not compatible with the latest woocommerce version 2.4.3, and that it was magic zoom that was causing product variation not to work. Please, all forum members using magic zoom should note this. See the link of my communication with Mike Jolley:
https://wordpress.org/support/topic/product-variation-no-more-working?replies=20#post-7296590August 13, 2015 at 12:10 pm #129022stardriveDear Tom,
Please, I mean the function did not work. It set the left sidebar to be the sidebar for all WooCommerce pages, including the single product pages.
August 13, 2015 at 1:21 pm #129048TomLead DeveloperLead DeveloperTry 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() && ! is_single() ) return 'left-sidebar'; // Or else, set the regular layout return $layout; }
August 13, 2015 at 2:12 pm #129068stardriveGreat!!
It is working perfectly now.
Thank you so much.Best Regards,
Stardrive
August 13, 2015 at 2:12 pm #129069TomLead DeveloperLead DeveloperYou’re welcome π
July 20, 2017 at 5:06 am #352184TullyHi Tom,
Just discovered your Woocommerce section of updated GP Premium – fantastic! Fixes this issue instantly and many others also. Still the best theme and support out there!
July 20, 2017 at 9:12 am #352317TomLead DeveloperLead DeveloperThank you! π
August 20, 2018 at 9:32 am #654596Daan vanHi Tom,
On the same topic I’m experiencing some difficulties myself and I seem not be able to fix it even with the thread here above.
I want on the WC shop page the sidebar on the left and with the products no sidebar.
This is a problem for the new site http://www.wiegenco.nl. I find it strange since on my previous site (www.cribster.nl) the GP layout options do work on the Shop and product pages.For example product page:
https://www.wiegenco.nl/winkel/merken/snuz/snuzpod3/For shop page:
https://www.wiegenco.nl/winkel/I’ve put the website on visible for the time being so you can take a look, but it is of course still only the rough draft π
Thank you for your help again!
August 20, 2018 at 9:41 am #654614Daan vanFYI, already added this snippet:
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;}
But of course it only fixed the Shop page.
-
AuthorPosts
- You must be logged in to reply to this topic.