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

Home Forums Support [Resolved] Hide menu and/or footer in blog but not in the woocommerce shop

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

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #500393
    David

    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?

    #500715
    Leo
    Staff
    Customer Support

    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;
    }
    #500777
    David

    Works like a charm, thank you.

    #500828
    Leo
    Staff
    Customer Support

    No problem πŸ™‚

    #670919
    David

    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.

    #670956
    David
    Staff
    Customer Support

    Hi there, that code Leo provided is CSS:

    https://docs.generatepress.com/article/adding-css/

    Code snippets is only for PHP πŸ™‚

    #670977
    David

    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.

    #671011
    David
    Staff
    Customer Support

    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

    #671038
    David

    Great!!!

    #671046
    David
    Staff
    Customer Support

    Yes it is πŸ™‚ Glad i could help

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.