- This topic has 9 replies, 8 voices, and was last updated 4 years, 11 months ago by
David.
-
AuthorPosts
-
June 26, 2015 at 6:33 am #116753
Roberto Enrique
Hi, I would like to know if there’s a way to have a menu bar that behaves like this:
On big screen:
On small screens:
Thanks in advance
June 26, 2015 at 2:52 pm #116829Tom
Lead DeveloperLead DeveloperOur next add-on will handle this, but for now you can do this:
1. Insert your logo into the nav:
add_action('generate_inside_navigation','generate_navigation_logo'); function generate_navigation_logo() { ?> <div class="site-logo"> <img src="THE URL TO YOUR IMAGE" alt="" /> </div> <?php }
Add CSS to style it:
.main-navigation .site-logo { float: left; line-height: 60px; /* Adjust this to your menu item height */ margin-right: 1.5em; }
2. Add a mobile logo to the mobile menu bar:
add_action( 'generate_inside_mobile_menu', 'generate_add_mobile_menu_logo' ); function generate_add_mobile_menu_logo() { <div class="site-logo"> <img src="THE URL TO YOUR MOBILE IMAGE" alt="" /> </div> }
Give that a try and let me know how it works out – might need some tweaking 🙂
July 7, 2015 at 11:17 am #119290jazmin Harb
Where do I insert the code to insert my logo into the nav bar?
Thank you.
July 7, 2015 at 6:23 pm #119369Tom
Lead DeveloperLead DeveloperJuly 15, 2015 at 11:49 pm #121416Rob
Hi, I would like to have the logo in the nav. Could you tell us where abouts in navigation.php the code needs to be added please.
Thanks in advance
July 16, 2015 at 10:29 am #121558Tom
Lead DeveloperLead DeveloperHi Rob,
This option is coming in our new add-on, but for now, this may help:
Insert your logo into the nav:
add_action('generate_inside_navigation','generate_navigation_logo'); function generate_navigation_logo() { ?> <div class="site-logo"> <img src="THE URL TO YOUR IMAGE" alt="" /> </div> <?php }
Adding PHP: http://generatepress.com/knowledgebase/adding-php-functions/
Then style it:
.main-navigation .site-logo { float: left; line-height: 60px; /* Adjust this to your menu item height */ margin-right: 1.5em; }
Adding CSS: http://generatepress.com/knowledgebase/adding-css/
February 25, 2017 at 3:26 am #283756Alexander
hi there,
was it implemented now so i dont have to use the code anymore??
Thanks in advance and keep up the great work, i love generatepress !!
atti
February 25, 2017 at 6:42 am #283839Leo
StaffCustomer SupportHi Alexander,
Yes this has already been implemented. Check out this page: https://docs.generatepress.com/article/navigation-logo/
Make sure your GP theme (1.3.44) and Premium (1.2.94) are up to date!
March 14, 2020 at 2:43 am #1194428Vikram
I added php and css both but this is not working…please help me
March 14, 2020 at 4:55 am #1194531David
StaffCustomer SupportHi there,
this is a really old topic – you can simply enable the Navigation as Header option in Customizer > Layout > Header.
https://docs.generatepress.com/article/navigation-as-a-header/
If you have a different requirement, can you start a new topic where you can share a link to your site and we can advise.
-
AuthorPosts
- You must be logged in to reply to this topic.