Site logo

Archived topic

Transparent & sticky header sitewide?

14 replies · Started by Ash on October 4, 2020

Viewing posts 1–15 of 15

How do I create it?
When I use an Element with entire site condition, sticky header does not work.

Hi,

You can set the transparency of header through Appearance > Customize > Colors > Header.

The color picker allows you to set it's alpha (opacity).
colors

If you're using a custom header, you may have to use custom CSS w/ rgba() as background-color values so you can set its transparency.

Where can I find Merge with Content option for normal header but Element?

Where can I find Merge with Content option for normal header but Element?

I'm not sure what you mean by this. Can you give more details? Thank you.

I mean this. so the header is like sticky from the moment the page is loaded.
https://share.getcloudapp.com/qGuvgWvr

I need the header that's like always sticky and transparent sitewide.

To clarify, what you're trying to do is merge the page hero w/ the header nav and keep the nav sticky for the entire site?

Something like this? demo site

For the sticky part:

You can make the header navigation sticky by enabling it on Appearance > Customize > Layout > Sticky Navigation.

For turning the header navigation transparent:
You can set the alpha values of the header's background color so it appears transparent as mentioned on the previous reply.

As for merging the normal header:
I'm still not sure what you mean by this. Perhaps you meant merging the navigation with the normal header.

To do that, you can go to Appearance > Customize > Layout > Header and check Use Navigation as Header.

Also, making your Header Element merge shouldn't interfere with the sticky effect. What'll happen is it will detach itself from the merged header and stay sticky.

Yes similar to the demo site you linked.

When merged header enabled with an Element, content should start from top 0px means part of content can overlap(underneath) with the header.

I may be able to create this with position:fixed attribute but I asked you if there's built-in option.

I see, Use Navigation as Header is close to what I want.
But I'd like to keep the tagline.

I see, Use Navigation as Header is close to what I want.
But I’d like to keep the tagline.

You can keep the setting and just add the timeline by adding this PHP snippet.

add_filter( 'generate_site_title_output', function( $output ) {
    $tagline = '<div class="site-description">Your tagline here</div>';

    return $output . $tagline;
} );

Reference: https://docs.generatepress.com/article/navigation-as-a-header/

Hmm, the tagline doesn't show up with your filter...?

Can Header Element inherit sticky setting from regular header? or it has a setting for itself?

If it can't be sticky, I will use position:fixed.

The sticky navigation option in the Customizer doesn't care if it's a merged header or not - it should work the same as any other page.

Thank you.

No problem :)

This archived topic is closed to new replies.