[Resolved] Disable Header on mobile

Home Forums Support [Resolved] Disable Header on mobile

Home Forums Support Disable Header on mobile

Viewing 15 posts - 1 through 15 (of 35 total)
  • Author
    Posts
  • #872817
    Karel

    Hello,

    I have full-screen elements header for all posts on desktop, but I would like to disable that header for mobile devices and have only the H1 with meta-data.

    IΒ΄m trying to figure out how to do it but still no success … I tried already


    @media
    (max-width: 768px) {
    .page-hero {display:none}
    }

    but that disables even front page header which I want to keep.

    Thank you for any advice πŸ™‚

    #872841
    Leo
    Staff
    Customer Support

    Hi there,

    Try this:

    @media(max-width: 768px) {
        body.single #mobile-header {
            display:none !important;
        }
    }

    Let me know πŸ™‚

    #872857
    Karel

    Hi Leo,

    Sorry, that did not work, no change.

    #872898
    Leo
    Staff
    Customer Support

    Ahh that’s because you are using the mobile header.

    Do you only want to hide it on home page?

    Let me know πŸ™‚

    #872917
    Karel

    No, I want to hide header in every post, but keep it on home page.

    #872944
    Leo
    Staff
    Customer Support

    Can you try the edited CSS here?
    https://generatepress.com/forums/topic/disable-header-on-mobile/#post-872841

    Let me know πŸ™‚

    #873196
    Karel

    I tried the edited one, but it is hiding my logo and menu button ( not the featured picture).

    I would like to keep menu button, logo and post title with metadata. I need to hide only the featured picture in the header ( except Main page ).

    #873639
    Tom
    Lead Developer
    Lead Developer

    You could try this:

    @media (max-width: 768px) {
        .single .page-hero {
            display:none
        }
    }

    Let me know πŸ™‚

    #873688
    Leo
    Staff
    Customer Support

    Make sure to choose merge on desktop only for that page hero as well:
    https://docs.generatepress.com/article/header-element-overview/#merge-with-content

    #875115
    Karel

    It seems like it works.

    The header is hidden now but with him even Heading with metadata … is there any chance to show it without a featured image?

    Or i have to make another Heading ?

    Thank you for your help πŸ™‚

    #875196
    Leo
    Staff
    Customer Support

    Hmm give this a shot:

    @media (max-width: 768px) {
        .single .page-hero {
            background-image: none;
        }
    }
    #875777
    Karel

    well, no success with that so I will stick with …


    @media
    (max-width: 768px) {
    .single .page-hero {
    display:none
    }
    }

    and I will make a new Heading.
    Is there any way how to show metadata ( like {{post_author}} | {{post_date}} | {{post_terms.taxonomy}} ) under the new heading?
    Probably with use of hook right?

    #875804
    Leo
    Staff
    Customer Support

    Hmm how come the CSS here didn’t work?
    https://generatepress.com/forums/topic/disable-header-on-mobile/#post-875196

    What was the issue? Can you apply it so I can see?

    #875915
    Karel

    Sorry my mistake, the code is working but not as I need.

    I would like to have full-screen header with a picture on the desktop , but for mobile devices, I would like to have only Heading and Meta-Classes ( {{post_author}} | {{post_date}} | {{post_terms.taxonomy}} ) under it.

    For example:

    Lovely day in London
    By Charlie / 22.04.2019 / In the United Kingdom

    Sorry for any misunderstanding.

    #875939
    Leo
    Staff
    Customer Support

    I’m still a bit confused…

    Isn’t the format you want the same as the page hero without the background image?

    What exactly wasn’t working when this CSS is used?
    https://generatepress.com/forums/topic/disable-header-on-mobile/#post-875196

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