Archived topic
Hide menu and/or footer in blog but not in the woocommerce shop
9 replies · Started by David on February 19, 2018
Hello, I have both blog and woocommerce under the Generatepress theme and want to hide primary menu and/or footer in the blog but not on the shop page. I used:
.blog .main-navigation,
.archive .main-navigation {
display: none;
}
.blog .footer-widgets,
.archive .footer-widgets {
display: none;
}
The thing is that Woocommerce is probably blog based and that causes the CSS code to hide Menu and Footer both in the blog and the shop. Is there a way to hide menu and footer in blog only but not in the shop at the same time?
Hi there,
Try this:
.blog .main-navigation,
.archive:not(.post-type-archive-product) .main-navigation {
display: none;
}
.blog .footer-widgets,
.archive:not(.post-type-archive-product) .footer-widgets {
display: none;
}
Works like a charm, thank you.
No problem :)
Hello, it shows the following when I enter the code:
ParseError thrown
syntax error, unexpected '.', expecting end of file
I use "Code Snippets" plugin, so far it had worked.
Hi there, that code Leo provided is CSS:
https://docs.generatepress.com/article/adding-css/
Code snippets is only for PHP :)
Hides in the blog now, but in the woocommerce shop storefront too. The menu shows in the Cart and other parts of the shop except the storefront page.
Hi there,
sorry didn't realise how old the topic was, you may want to use the new Elements module to disable elements:
https://docs.generatepress.com/article/layout-element-overview/
The shop will be the Product Archives display rule
Great!!!
Yes it is :) Glad i could help