Created
January 25, 2013 21:05
-
-
Save WebEndevSnippets/4637836 to your computer and use it in GitHub Desktop.
Genesis: Add classes to Genesis Navigation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Add classes to Genesis Navigation | |
| * | |
| */ | |
| add_filter( 'genesis_do_nav', 'webendev_override_do_nav', 10, 3 ); | |
| function webendev_override_do_nav($nav_output, $nav, $args) { | |
| $args['menu_id'] = 'the_id_you_want'; | |
| $args['menu_class'] = 'class1 class2'; // replace what was there | |
| $args['menu_class'] .= ' nav-bar'; // or append to it | |
| if ( genesis_get_option( 'nav' ) ) { | |
| if ( has_nav_menu( 'primary' ) ) { | |
| $nav = wp_nav_menu( $args ); | |
| } elseif ( 'nav-menu' != genesis_get_option( 'nav_type', 'genesis-vestige' ) ) { | |
| $nav = genesis_nav( $args ); | |
| } | |
| } | |
| return sprintf( '<div id="nav">%2$s%1$s%3$s</div>', $nav, genesis_structural_wrap( 'nav', 'open', 0 ), genesis_structural_wrap( 'nav', 'close', 0 ) ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment