Site logo

Archived topic

Disable Header on mobile

34 replies · Started by Karel on April 18, 2019

Viewing posts 1–15 of 35

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 :)

Hi there,

Try this:

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

Let me know :)

Hi Leo,

Sorry, that did not work, no change.

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

Do you only want to hide it on home page?

Let me know :)

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

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 ).

You could try this:

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

Let me know :)

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 :)

Hmm give this a shot:

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

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?

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.

This archived topic is closed to new replies.