• Resolved omaracra

    (@omaracra)


    Hello everyone, i’m using GeneratePress as my theme,
    I want to disable the header and footer on a specific page, I did some searchs and found a css code, but it does’t work on my website.
    Like I want to disable footer and header on this page, ID=421

    .page-id-421 .footer_bar {
    visibility: none;
    }
    >?php

    this code doesn’t work for me, thanks for all helps

Viewing 7 replies - 1 through 7 (of 7 total)
  • Leo

    (@leohsiang)

    Hi there,

    Remove what you’ve added and try this instead:

    body.page-id-421 .site-header, body.page-id-421 .site-footer {
        display: none;
    }

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

    Let me know if this helps ??

    Thread Starter omaracra

    (@omaracra)

    Hello Leo, Thanks for your answer.
    I tried it in my css additional but doesn’t also work.
    And i’m using snippets plugin to create some code css, when I try to save this code, the plugin show that following message : the snippets code has disabled that css code due to a error on line one.

    I don’t know if I did something wrong somewhere.

    Leo

    (@leohsiang)

    Hmm the code itself doesn’t have any errors.

    Are you using Code Snippets plugin? If so that’s actually for PHP, not CSS.

    Adding it to Additional CSS field should work unless you have syntax errors in there already.

    You can test by inserting my code to the top of Additional CSS field.

    Thread Starter omaracra

    (@omaracra)

    Hi Leo,
    You are right, I have installed another plugin for css and it works now (simple css).
    Is any way to also disable the main menu on the same page only?

    Leo

    (@leohsiang)

    This should be the full CSS:

    body.page-id-421 .site-header, body.page-id-421 .site-footer, body.page-id-421 .main-navigation {
        display: none;
    }

    I should also mention that our Layout Element and Disable Elements add-ons are perfect for this:
    https://docs.generatepress.com/article/layout-element-overview/
    https://docs.generatepress.com/article/disable-elements-overview/

    Let me know ??

    Thread Starter omaracra

    (@omaracra)

    Hi Leo,
    Thanks very much for all these answers.
    Everything works as well now.
    Thanks.

    Leo

    (@leohsiang)

    Glad I could help ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Disable Footer and Header on a specific page’ is closed to new replies.