Archived topic
Sidebar layout home page not working
9 replies · Started by Damiaan van Vliet on November 25, 2016
Hi, for some reason the sidebar layout on the home page is not working.
I have woocommerce installed. So it is on the shop page.
I edit the page, sidebar/content.
I have filled the sidebar with widgets.
Don't know what to do else.
With default theme no problem.
Strange...
If the page is an index (blog page, main WooCommerce page), the meta box settings won't apply. This is a WP limitation.
Instead, while looking at the page you want to edit, click the "Customize" button in the admin bar. Then go to "Layout > Sidebars" to adjust the layout.
If you want a different sidebar layout for WooCommerce only, check out the first PHP snippet on this page: https://generatepress.com/knowledgebase/choosing-sidebar-layouts/#sidebar-filter
Let me know if you need more info :)
Hi Tom,
I tried customize, layout, sidebar but sidebar is not visible.
webshop
Thanks.
Which page are you trying to add the sidebar to? The home page?
When you view the home page and click "Customize" (so you're looking at the home page in the Customizer), what's the "Layout > Sidebars" value set to?
content / sidebar
shall I send you login details and set site in English language?
Sure, no need to set it to English - I know my way around :)
Send you login details, Tom. Thanks a ton!
You have this added in your custom functions:
/* hide sidebar on woocommerce pages */
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 'no-sidebar';
// Or else, set the regular layout
return $layout;
}
That will override the setting in the Customizer.
Great! That's it! From a different shop I used some files.
Thank you.
You're welcome :)