Change or remove the text beside the mobile menu icon.
Genesis 3.0 introduced an “AMP-compatible, responsive menu that theme developers can add via ‘genesis_register_responsive_menus()’, in place of having to enqueue their own responsive menu scripts” (from Genesis CHANGELOG.md). The “Menu” text beside the hamburger menu icon is now set in PHP rather than in JS.
If you want to change or delete the “Menu” text you will need to edit the array that is passed to ‘genesis_register_responsive_menus()‘. Genesis Sample 3.0 uses a configuration file in genesis-sample/config/responsive-menus.php to do this. It does not specify the text so the default (“Menu“) from init_config() in genesis/lib/classes/class-genesis-menu-handler.php is used.
Here’s how the mobile menu displays, with a hamburger icon and the text to its right:

Change the text
To change the text in Genesis Sample you need to add a line to genesis-sample/config/responsive-menus.php:
'mainMenu' => 'XYZ', // Change the text from 'Menu'
This is the result:

To omit the text to the right of the icon simply empty the ‘mainMenu’ string:
'mainMenu' => '', // Empty string so that there is no text beside the icon.
A filter would be easier
I always avoid changing theme files, creating a child theme or functional plugin that achieves the same result. If I were to use Genesis Sample I would prefer to leave the theme unchanged and use a functional plugin. I did exactly this on the Shapemoda site.
I could not find a way to change the ‘mainMenu’ without editing the genesis-sample/config/responsive-menus.php file. I am going to propose to StudioPress that a filter be added to the init_config() function of genesis/lib/classes/class-genesis-menu-handler.php
This simple plugin will change “Menu” to “XYZ“:
Leave a Reply