Archived topic
Remove Sidebar
15 replies · Started by Nicholas on February 28, 2017
Hi,
Thanks again for a great theme and support, it has been a extremely nice process working with generatepress theme.
I'm having a small issue, I would either like to remove my blog sidebar or change it to a different sidebar all together. The issue I am having is that my Woocommerce page is using the same sidebar as my blog, so if I remove in global settings the blog sidebar it removes my Woocommerce sidebar. I also don't want to use the same sidebar that I use on my Woocommerce page on my blog page because it is not relevant. So how would I go about removing just the blog sidebar.. or changing its contents completely.
Hi Nicholas,
Glad you are enjoying GP :)
The setting should be in Customizer > Layout > Sidebars > Blog Sidebar Layout.
Let me know if this helps.
The problem with setting that to Content(No sidebar) is that it also takes it off my WooCommerce Shop page? Im not sure why it uses the blog layout but it apparently does.
ahh yes WooCommerce pages are also index pages. Try this CSS then:
.blog .sidebar {
display: none;
}
Adding CSS: https://docs.generatepress.com/article/adding-css/
Let me know if this works.
Instead of using CSS, you should use a filter: https://docs.generatepress.com/article/sidebar-layout/#using-a-function
There's a lot of examples there, including how to target WooCommerce :)
ahh right. If you want to hide sidebar on normal blog page and keep it on WooCommerce, then try this:
add_filter( 'generate_sidebar_layout','tu_custom_category_sidebar_layout' );
function tu_custom_category_sidebar_layout( $layout )
{
// If we are on blog page, set the sidebar
if ( is_home() )
return 'no-sidebar';
// Or else, set the regular layout
return $layout;
}
Adding PHP: https://docs.generatepress.com/article/adding-php/
Let us know.
Leo, that was easy :D. Thank you (def an option for me to use if I can't figure other option out)
Tom, is there a way with the functions for Woocommerce, to allow that to have a different right sidebar then my blog page? The Woocommerce page having my cart widget etc.. and my blog sidebar showing my recent posts widgets etc?
You're welcome :)
Can try using a plugin like this:
https://en-ca.wordpress.org/plugins/custom-sidebars/
There's also Content Aware Sidebars, Easy Custom Sidebars, Display Widgets etc..
Lots of options :)
Oh okay perfect I will look into some of those plugins, thank you both!
Always impressed by the quick response and support and I have only had the theme for a week :D thanks!
We try our best to keep up! :)
Hi Leo
How do I completely remove the sidebars?
When I go to pages>screen options there's no sidebar layout being listed.
I went to disable element to content(no sidebars) save update and refresh.
the sidebar is still there when i view my site.
help please
basically i want to use element or to customise my theme.
The global sidebar layout options are in the customizer: https://docs.generatepress.com/article/sidebar-layout/
If you need additional info, please open a new topic.
I wanted to chime in here. I've been using GeneratePress now for about 5 years as a premium customer, and I ran into the same situation as others in GeneratePress being perceived as more of a blogger's template. Nothing could be further from the truth! I am now creating an eCommerce site to begin a dropshipping business. The control for premium customers over the theme and especially WooCommerce is like nothing else out there! I was able to take the advice Leo las mentioned, and was able to easily turn off all of the sidebars with just a simple dropdown selection under Customize->Layouts. If you are not a premium customer, you owe it to yourself to get on board. Thank you Leo, for a great product in GeneratePress/Premium and endless support second to none!