Site logo

Archived topic

Hide menu and/or footer in blog but not in the woocommerce shop

9 replies · Started by David on February 19, 2018

Viewing posts 1–10 of 10

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.

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.

Great!!!

Yes it is :) Glad i could help

This archived topic is closed to new replies.