Skip to content

Instantly share code, notes, and snippets.

@csbeck
Created July 8, 2014 18:06
Show Gist options
  • Save csbeck/c324f36196ab2617ea25 to your computer and use it in GitHub Desktop.
Save csbeck/c324f36196ab2617ea25 to your computer and use it in GitHub Desktop.
Genesis Custom Submenus (tabs)
/**
* Submenu customizations (tabs)
* Created by Becker Design Studio
* http://www.beckerstudio.com
**/
remove_action('genesis_after_header', 'genesis_do_subnav');
add_action('genesis_before_post_content','my_custom_subnav');
function my_custom_subnav () {
/* use if and else if statements to determine what page we're on to know what submenu to show */
if ( is_page(46) || is_page(185) || is_page(191) || is_page(196) ) {
echo '<div id="subnav"><div>'; /* open the divs */
wp_nav_menu( array('menu' => 'Submenu_BecomeAPartner' )); /* name of menu */
echo '</div></div>'; /* close the divs */
} else if ( is_page(14) || is_page(93) || is_page(95) || is_page(638) ) {
echo '<div id="subnav"><div>';
wp_nav_menu( array('menu' => 'Submenu_Products_Connectors' ));
echo '</div></div>';
/* repeat more else if's if necessary */
} else { /* otherwise show the subnav if needed */
genesis_do_subnav();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment