- This topic has 11 replies, 2 voices, and was last updated 4 years, 8 months ago by
Leo.
-
AuthorPosts
-
April 28, 2019 at 1:40 pm #882532
Miro
Hello!
In my header, I have a logo, site title, tagline and menu.
When I scroll down and the sticky header appears, site title and tagline don’t show.I have found a couple of similar posts in this forum but haven’t been able to successfully implement the hooks which were advised to be used as a solution of the issue.
The weirdest thing is that the title and tagline showed alright a few days ago.
Logic dictates I must have messed something up but I am not at all aware of what it might be.Would be grateful for any assistance.
Thank you.Miro
April 28, 2019 at 8:19 pm #882682Tom
Lead DeveloperLead DeveloperHi Miro,
The site title and tagline don’t show in the sticky navigation by default.
The site title can display in the sticky navigation if you set your navigation as your header: https://docs.generatepress.com/article/navigation-as-a-header/
Otherwise, we can use hooks to add them into the sticky nav if you’d like.
Let me know ๐
April 29, 2019 at 2:23 am #882914Miro
Hello Tom,
thanks for a quick reply. I tried setting the navigation as header but didn’t like the look of the outcome. Tagline disappeared and the whole header got more narrow even before scrolling.I would like to have the header as it is now. Then, when it sticks after scrolling, I would like to have the site title displayed (not the tagline). Could you, please, give me a hand with creating the hook you mentioned?
April 29, 2019 at 8:34 am #883371Tom
Lead DeveloperLead DeveloperDefinitely! Any chance you can remove the coming soon page so I can make sure the HTML/CSS I give you will work first try?
Let me know ๐
April 29, 2019 at 8:38 am #883374Miro
Of course. Done.
April 29, 2019 at 4:06 pm #883727Tom
Lead DeveloperLead DeveloperLet’s try this function:
add_filter( 'generate_sticky_navigation_logo_output', function( $output ) { $title = '<div class="sticky-navigation-title">Your Title Here</div>'; return $output . $title; } );Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know ๐
April 29, 2019 at 8:43 pm #883829Miro
Thanks Tom, the function works like a charm!
And by the way, thank you for the best wp theme ever. ๐Have a great day.
Miro
April 30, 2019 at 8:22 am #884500Tom
Lead DeveloperLead DeveloperAwesome! Thank you for using it!
You too ๐
February 24, 2021 at 7:39 pm #1671511David
Hi Tom, I am trying this snippet on this site and having no luck. Any thoughts? subliminaryartworks.com
I am using Code Snippets as per suggestion. Thanks much, Dave
February 24, 2021 at 7:46 pm #1671521Leo
StaffCustomer SupportAny chance you can open a new topic for your question?
This one is a bit old.
Thanks!
February 25, 2021 at 7:11 am #1672319David
Done.
February 25, 2021 at 3:00 pm #1672935Leo
StaffCustomer SupportThanks ๐
-
AuthorPosts
- You must be logged in to reply to this topic.