- This topic has 14 replies, 3 voices, and was last updated 4 years, 11 months ago by Tom.
-
AuthorPosts
-
May 4, 2019 at 6:49 am #888890AJ
I’m working on a site and I’d like to use the GP header for most cases since the Elementor header isn’t very responsive, in my opinion.
Is there a way for me to set up the GP header so that it’s similar to this header β https://flwaterdamagerestoration.com/ with the CTA button on the right? Check out the mobile version too.
Thanks again!
May 4, 2019 at 8:01 am #888963TomLead DeveloperLead DeveloperI would:
1. Set up my navigation as the header: https://docs.generatepress.com/article/navigation-as-a-header/
2. Add a button to my navigation: https://docs.generatepress.com/article/adding-buttons-navigation/To add it to mobile, I would:
1. Create a new Hook Element: https://docs.generatepress.com/article/hooks-element-overview/
2. Set the hook toinside_navigation
3. Add this as your content:<div class="mobile-bar-items"> <a class="button your-button-class" href="URL TO YOUR BUTTON">Your button text</a> </div>
Let me know if you need more info π
May 4, 2019 at 9:42 am #889035AJThanks, Tom.
Works like a charm on desktop. Played around with the CSS a bit to get it where I wanted on desktop. However, I’m having a little more trouble on mobile/tablet.
I’d like to maybe increase the size/scale of the header on mobile a tad bit. Also, I know the logo isn’t super conducive for mobile, but it also seems to be misaligned from the left.
For reference, here’s the other one.
Also, regarding toggling the mobile menu, how difficult would it be to set it up like the ERS one where it goes full screen?
Thanks again!
May 4, 2019 at 3:56 pm #889191TomLead DeveloperLead DeveloperYou can increase the height by increasing the menu item height on mobile: https://docs.generatepress.com/article/menu-item-height-width/
The logo looks like it might be a bug – I’ll look into it. Try adding this CSS for now:
@media (max-width: 768px) { .nav-aligned-center #site-navigation .navigation-branding, .nav-aligned-center #sticky-navigation .navigation-branding { margin-left: 0; margin-right: auto; } }
May 4, 2019 at 4:40 pm #889208AJThis is how the mobile header/nav was at the default menu item height β http://prntscr.com/nkic7j
This is where I had it before, 50px β http://prntscr.com/nkichm
If I increase it anymore the menu items have way too much height on mobile.
From this at 50px β http://prntscr.com/nkichm
To this at 65px β http://prntscr.com/nkidg0Is there a way to increase the padding(?) or height of the header/nav bar without increasing the individual menu item heights?
Also, the CSS for the logo worked, thanks for that!
May 5, 2019 at 7:46 am #889721TomLead DeveloperLead DeveloperI would increase the height using the option, then decrease the menu item height with some CSS:
@media (max-width: 768px) { .main-navigation .main-nav ul li a { line-height: 50px; } }
May 5, 2019 at 8:09 am #889741AJPerfect, that seems to work nicely. Added a bit of margin to .mobile-bar-items as well. Looks good.
Doing some testing and I’m not sure if the CSS code to fix the logo is working, but I could be wrong.
@media (max-width: 768px) { .nav-aligned-center #site-navigation .navigation-branding { margin-left: 0; margin-right: auto; } }
Pixel 2XL. Looks good, this is what I’m aiming for β http://prntscr.com/nkpc8v
iPhone 6,7,8,X. Not so much β http://prntscr.com/nkpcim β Is there some CSS to make it all inline?Here’s an iPad view as well. β http://prntscr.com/nkpd2k
May 5, 2019 at 12:42 pm #889906TomLead DeveloperLead DeveloperWhere did you add that CSS? I’m not seeing it on your site.
You might want to make sure there are no syntax errors in the CSS above it: https://jigsaw.w3.org/css-validator/
May 6, 2019 at 8:17 am #890796AJShould be there now. Was commenting it in and out testing. The issue still exists on my end.
Also checked the CSS validator, don’t see any syntax errors for the CSS we’ve added. At least from what I can tell.
May 6, 2019 at 8:36 am #890812DavidStaffCustomer SupportHi there,
i can’t see the CSS in the site? Did you add it to a child theme or Additional CSS? You may want to flush and disable the cache.
May 6, 2019 at 9:01 am #890837AJAdded to the stylesheet in the child theme.
I’ve also purged the cache.
As I’m writing this I went ahead and added the CSS to the additional CSS section within the WordPress customization menu. Is that where we should be adding them? All the other CSS worked within the child theme stylesheet.
Thanks
May 6, 2019 at 11:26 am #890978AJI take that back, it works on the first load, but once I scroll the positions change.
May 6, 2019 at 3:50 pm #891135TomLead DeveloperLead DeveloperCan you try the updated CSS here?: https://generatepress.com/forums/topic/header-nav-layout-changes/#post-889191
May 6, 2019 at 4:16 pm #891154AJThe updated code works like a charm. Thanks Tom.
May 6, 2019 at 4:35 pm #891167TomLead DeveloperLead DeveloperYou’re welcome π
-
AuthorPosts
- You must be logged in to reply to this topic.