Archived topic
Items only shown in mobile menu
3 replies · Started by mkjj on July 27, 2021
We have a newsletter button for desktop displays. We don't have this item in the desktop menu (it is rather a header widget), but would like to have it in the header mobile menu. As far as I understand, we could register a second menu for mobile only like described here.
Would this create an additional HTML structure that would be hidden on desktop displays? This would not be best practice from a SEO point of view, since it would create duplicate links sitewide. At least, this is what our SEO expert says. He strongly recommends not to use two separate menus for desktop and mobile.
It would be ok, if the mobile menu replaced the standard navigation without having two more or less identical HTML menus in the source code.
Thank you!
Hi there,
the simplest solution would be to use a Hook ( or Block ) Element to insert your button into: generate_menu_bar_items hook. This will display on both Desktop and Mobile nav/headers. Beside where the hamburger/search icons are displayed.
Excellent solution. I always underestimate the power of hooks. So versatile! Thank you!
Glad to be of help