Archived topic
How to keep main-title with sticky menu
7 replies · Started by david on November 25, 2022
Hi,
How to keep main-title with sticky menu and how center menu and items social
Hi there,
can i see the site you're working on?
off course here is the link :
http://diesety.cluster031.hosting.ovh.net/
I would like the sticky menu to be like the start menu
OK, lets get the title in there first. As its not a built in option we need to do some shenanigans:
1. You will need to add a Logo image to the Customizer > Layout > Sticky Nav.
2. Add this PHP Snippet to your site:
add_filter( 'generate_sticky_navigation_logo_output', function() {
return sprintf(
'<%1$s class="main-title" itemprop="headline">
<a href="%2$s" rel="home">
%3$s
</a>
</%1$s>',
( is_front_page() && is_home() ) ? 'h1' : 'p',
esc_url( apply_filters( 'generate_site_title_href', home_url( '/' ) ) ),
get_bloginfo( 'name' )
);
} );
It will replace the fake logo with the site title.
Once thats there let me know and ill review your CSS for centering the menu
Hello,
Thank you for your reply. I pasted the code with Code Snippets. it doesn't seem to work.
Thanks
Did you add the logo to the Customizer > Layout > Sticky Nav ? It just needs an image in there.
it works thank you very much !
Glad to hear that