[Resolved] generate_after_mobile_menu_button hook issue

Home Forums Support [Resolved] generate_after_mobile_menu_button hook issue

Home Forums Support generate_after_mobile_menu_button hook issue

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1600148
    George

    When adding a block element and set it to the generate_after_mobile_menu_button hook, the block seems to be visible on the left side of the nav area on the desktop view. Shouldn’t that hook be active only on the mobile view?

    #1600261
    Leo
    Staff
    Customer Support

    Hey George,

    That’s a good point πŸ™‚

    I don’t think this can be improved though as we are using display: block; to display the toggle on mobile:
    https://www.screencast.com/t/EYdNNia8yZ

    I’ll ask Tom about this.

    For now, the workaround would be adding the hide-on-desktop hide-on-tablet classes to your content.

    Let me know if this helps πŸ™‚

    #1600900
    George

    Hi Leo. I was just testing it by accident and thought was a bit weird. Your solution is a good workaround, though. Shall I leave the thread open until you hear from Tom about it?

    #1601109
    Leo
    Staff
    Customer Support

    Tom said using the class is the best bet.

    You can use wp_is_mobile() too but it won’t work with browser resizing:
    https://developer.wordpress.org/reference/functions/wp_is_mobile/

    #1602039
    George

    I just wanted to know if this was actually a bug and could be solved for the next release. Hopefully, Tom will have a look at it.

    Thank you Leo!

    #1602112
    Leo
    Staff
    Customer Support

    It’s not a bug.

    Thanks for pointing it out though – it’s new to me too πŸ™‚

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