- This topic has 11 replies, 4 voices, and was last updated 3 years, 1 month ago by
Tom.
-
AuthorPosts
-
May 8, 2019 at 9:24 am #893114
Colin
Hi,
I set my mobile menu breakpoint to 1100 via Customizer>Header>mobile breakpoint.
On pages where I use Elements and have the header set to “merge on desktop only”, the mobile header seems to merge with the header between (I think..?) 768 – 1100.
So, if I view these pages on an ipad in portrait mode the mobile menu does not merge with the header, which is what I want. But if I view it in landscape mode the header does merge with the header, which I don’t want. You can see this on any of my ‘Services’ pages, About, or Contact.
Is there a way around this, or did I miss something?
Thank you!
May 8, 2019 at 12:00 pm #893299Leo
StaffCustomer SupportHi there,
Not quite sure if I understand.
I checked every page in the primary menu and don’t see a header element added.
Can you double check?
Let me know π
May 9, 2019 at 6:30 am #894020Colin
Hi Leo,
Sorry, its entirely possible my wording isn’t accurate. I took a few screenshots to better explain.
Example #1 is how I want my mobile menu to look on all my ‘Services’, About, and Contact pages up to 1100 pixel width. The top pictures are separate from and not ‘merged’ with the mobile menu.
In example #2 and #3 those pictures are merged. They are underneath the mobile menu and that is what I do not want.
After 1100px, when it reverts to the desktop menu, I do want the top pictures and the menu to merge.
Thanks π
May 9, 2019 at 8:29 am #894294Tom
Lead DeveloperLead DeveloperAh, that option is for the mobile menu, but the option in the Header Element is for the mobile breakpoint (which may differ from the mobile menu breakpoint).
You can adjust it with this filter:
add_filter( 'generate_not_mobile_media_query', function() { return '(min-width: 1101px)'; } );
Let me know π
May 9, 2019 at 9:09 am #894343Colin
Hmm.. is this right? I didn’t publish
May 9, 2019 at 9:14 am #894351Tom
Lead DeveloperLead DeveloperAh, sorry – it should be added using one of these methods: https://docs.generatepress.com/article/adding-php/
May 9, 2019 at 10:44 am #894442Colin
Yes that worked! Thanks so much!! π
May 9, 2019 at 1:32 pm #894590Tom
Lead DeveloperLead DeveloperAwesome, glad I could help π
April 16, 2020 at 2:51 pm #1242169George
Hello. Sorry for barging in here! I tried this code to change the header element mobile breakpoint but it’s not working. Is the code still valid? Looking to activate header element mobile breakpoint earlier than 768px.
April 17, 2020 at 9:50 am #1243250Tom
Lead DeveloperLead DeveloperHey George,
The
generate_not_mobile_media_query
applies to desktop CSS only – not mobile.You can change the mobile media query, but it will change it throughout the plugin where it’s active:
add_filter( 'generate_media_queries', function( $queries ) { $queries['mobile'] = '(max-width:768px)'; return $queries; } );
April 17, 2020 at 10:00 am #1243261George
Yeah, this last code worked for me, Tom! I decided to go with a media query instead, though, since I had a few other sizes to tidy up.
Thank you!
April 17, 2020 at 4:37 pm #1243604Tom
Lead DeveloperLead DeveloperNo problem π
-
AuthorPosts
- You must be logged in to reply to this topic.