[Resolved] Mobile menu break point and header merge

Home Forums Support [Resolved] Mobile menu break point and header merge

Home Forums Support Mobile menu break point and header merge

  • This topic has 11 replies, 4 voices, and was last updated 4 years ago by Tom.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #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!

    #893299
    Leo
    Staff
    Customer Support

    Hi 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 πŸ™‚

    #894020
    Colin

    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 πŸ™‚

    #894294
    Tom
    Lead Developer
    Lead Developer

    Ah, 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 πŸ™‚

    #894343
    Colin

    Hmm.. is this right? I didn’t publish

    #894351
    Tom
    Lead Developer
    Lead Developer

    Ah, sorry – it should be added using one of these methods: https://docs.generatepress.com/article/adding-php/

    #894442
    Colin

    Yes that worked! Thanks so much!! πŸ™‚

    #894590
    Tom
    Lead Developer
    Lead Developer

    Awesome, glad I could help πŸ™‚

    #1242169
    George

    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.

    #1243250
    Tom
    Lead Developer
    Lead Developer

    Hey 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;
    } );
    #1243261
    George

    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!

    #1243604
    Tom
    Lead Developer
    Lead Developer

    No problem πŸ™‚

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.