Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove Menu from mobile menu in Genesis - Change or remove the text beside the mobile menu icon https://www.damiencarbery.com/2019/08/remove-menu-from-mobile-menu-in-genesis/
--- genesis/lib/classes/class-genesis-menu-handler.php.orig 2019-08-17 21:33:12.500494400 +0100
+++ genesis/lib/classes/class-genesis-menu-handler.php 2019-08-18 18:39:12.313318800 +0100
@@ -109,7 +109,7 @@
$extras = array_merge( $extras, $config['extras'] );
}
- return compact( 'script', 'extras' );
+ return apply_filters( 'genesis_menu_handler_init_config', compact( 'script', 'extras' ) );
}
<?php
/*
Plugin Name: Genesis Sample Menu text
Plugin URI: https://www.damiencarbery.com/2019/08/remove-menu-from-mobile-menu-in-genesis/
Description: Change the 'Menu' mobile menu text in Genesis Sample 3.0.
Author: Damien Carbery
Version: 0.1
*/
add_filter( 'genesis_menu_handler_init_config', 'dcwd_genesis_sample_menu_text' );
function dcwd_genesis_sample_menu_text( $config ) {
$config[ 'script' ][ 'mainMenu' ] = 'XYZ';
return $config;
}
<?php
/**
* Genesis Sample child theme.
*
* @package Genesis Sample
* @author StudioPress
* @license GPL-2.0-or-later
* @link https://my.studiopress.com/themes/genesis-sample/
*/
/**
* Genesis responsive menus settings. (Requires Genesis 3.0+.)
*/
return array(
'script' => array(
'mainMenu' => 'XYZ', // Change the text from 'Menu'
'menuClasses' => array(
'others' => array( '.nav-primary' ),
),
),
'extras' => array(
'media_query_width' => '960px',
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.