Skip to content

Instantly share code, notes, and snippets.

@topleague
Last active September 4, 2017 11:45
Show Gist options
  • Save topleague/199982998f9d44cd984dac9b935fd028 to your computer and use it in GitHub Desktop.
Save topleague/199982998f9d44cd984dac9b935fd028 to your computer and use it in GitHub Desktop.
Updating Markup in Responsive Menu Settings in Genesis Sample Theme
//* Set the Markup in Responsive Menu Settings Sections of Functions.php
// Credit: Sridhar Katakam
// Step #1 : Locate the following code in functions.php
// Define our responsive menu settings.
function genesis_sample_responsive_menu_settings() {
$settings = array(
'mainMenu' => __( 'Menu', 'genesis-sample' ),
'menuIconClass' => 'dashicons-before dashicons-menu',
'subMenu' => __( 'Submenu', 'genesis-sample' ),
'subMenuIconsClass' => 'dashicons-before dashicons-arrow-down-alt2',
'menuClasses' => array(
'combine' => array(
'.nav-primary',
'.nav-header',
),
'others' => array(),
),
);
return $settings;
}
// Step #2 [Option A]: If you want to display the hamburger menu icon WITH the Menu text, replace the above code with the following code.
// Define our responsive menu settings.
function genesis_sample_responsive_menu_settings() {
$settings = array(
'mainMenu' => sprintf( '<span class="hamburger-box"><span class="hamburger-inner"></span></span><span class="hamburger-label">%s</span>', __( 'Menu', 'genesis-sample' ) ),
'menuIconClass' => 'hamburger hamburger--slider',
'subMenu' => __( 'Submenu', 'genesis-sample' ),
'subMenuIconsClass' => 'dashicons-before dashicons-arrow-down-alt2',
'menuClasses' => array(
'combine' => array(
'.nav-primary',
'.nav-header',
),
'others' => array(),
),
);
return $settings;
}
// Step #2 [Option B]: If you want to to display just the hamburger menu icon WITHOUT the Menu text, replace the above code with the following code.
// Define our responsive menu settings.
function genesis_sample_responsive_menu_settings() {
$settings = array(
'mainMenu' => '<span class="hamburger-box"><span class="hamburger-inner"></span></span>',
'menuIconClass' => 'hamburger hamburger--slider',
'subMenu' => __( 'Submenu', 'genesis-sample' ),
'subMenuIconsClass' => 'dashicons-before dashicons-arrow-down-alt2',
'menuClasses' => array(
'combine' => array(
'.nav-primary',
'.nav-header',
),
'others' => array(),
),
);
return $settings;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment