- This topic has 7 replies, 4 voices, and was last updated 2 years, 3 months ago by Ying.
-
AuthorPosts
-
October 1, 2018 at 7:53 am #690782Ivan
Hello,
How to make a centered logo with hamburger menu (left) and search icon (right) on GP + GPP website for both mobile and desktop.
Something similar to that β https://imgur.com/a/4TPgVOu (desktop) https://imgur.com/a/AwUNjWt (mobile).
Thank you in advance.
Best regards,
VeselaOctober 1, 2018 at 2:56 pm #691073LeoStaffCustomer SupportHi there,
Good question π I’ve created a solution for you to test. All steps are required.
For desktop:
– Create a new menu with one custom link in it which is your logo image:
https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#custom-linkUse your home page address for URL and
<img src="URL TO YOUR LOGO" alt="Your site name" title="Your site name" />
for the Navigation Label.Then add
center-logo
in CSS Classes:
https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#custom-classesAssign this menu to the Primary Menu:
https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#setting-a-theme-location– Set both navigation widths to Full and alignment to Left:
https://docs.generatepress.com/article/navigation-layout/– Set navigation location to Below header:
https://docs.generatepress.com/article/navigation-location/– Make sure navigation search is activated:
https://docs.generatepress.com/article/navigation-search/– Add the following CSS:
.site-header { display: none; } @media (min-width: 769px) { .main-navigation ul { display: flex; } .main-navigation li.center-logo { order: 2; margin: auto; } li.slideout-toggle { order: 1; float: none; } li.search-item { float: none; z-index: 21; order: 3; } }
Adding CSS: https://docs.generatepress.com/article/adding-css/
This should be the final result: https://www.screencast.com/t/Z7GEKOjlZYzZ
For mobile:
– Activate the mobile header and upload a mobile header logo:
https://docs.generatepress.com/article/mobile-header/– Follow the instructions here:
https://docs.generatepress.com/article/centering-logo-mobile-header/Let me know π
October 2, 2018 at 12:53 am #691278IvanYou rock π
Thank you!October 2, 2018 at 9:08 am #691707LeoStaffCustomer SupportNo problem π
December 31, 2020 at 7:06 am #1600814DeirdreHi I have a similar issue and have been trying to fix it – My mobile header looks like this at the moment https://imgur.com/6kPWHcN and I am trying to center the logo. When I use this code from this page https://docs.generatepress.com/article/centering-logo-mobile-header/ the logo is centered and the menu hamburger is moved to the left which is perfect but then the search icon hovers over the middle of the logo like so: https://imgur.com/JjDQlEG
Any idea how to resolve it so that the search symbol stays on the right?
EDIT: Apologies, after searching more I discovered that the snippet below solved the issue, found it in this thread: https://generatepress.com/forums/topic/menu-toggle-logo-search-icon-layout-on-mobile/
.mobile-bar-items {
margin-left: auto;
}December 31, 2020 at 2:01 pm #1601104LeoStaffCustomer SupportGlad to hear π
August 15, 2022 at 9:15 am #2313591JimHi,
This time around, is there a cleaner way to display the hamburger menu on the left, the site logo in the middle, and the search icon on the right – on desktop and mobile?
When following the above instructions my site logo gets wrapped into an unordered list (item), which is not the best practice for a site logo.
A simpler solution with the help of the customizer would be very helpful.
Thanks in advance,
Jim
August 15, 2022 at 11:21 am #2313680YingStaffCustomer SupportHi Jim,
Can you open a support topic and link us to your site?
This topic is pretty old.
-
AuthorPosts
- You must be logged in to reply to this topic.