Created
November 9, 2013 05:21
-
-
Save JiveDig/7382036 to your computer and use it in GitHub Desktop.
Custom Genesis primary navigation extras
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 custom code to Genesis primary navigation extras | |
| // @link http://www.rfmeier.net/add-a-custom-primary-nav-extras-within-genesis/ | |
| add_filter( 'wp_nav_menu_items', 'custom_nav_item', 10, 2 ); | |
| function custom_nav_item( $menu, stdClass $args ){ | |
| // make sure we are in the primary menu | |
| if ( 'primary' != $args->theme_location ) | |
| return $menu; | |
| // see if a nav extra was already specified with Theme options | |
| if( genesis_get_option( 'nav_extras' ) ) | |
| return $menu; | |
| // additional checks? | |
| // append your custom code | |
| $menu .= sprintf( '<li class="right">%s</li>', __( 'Call Today! (908) 441-2659' ) ); | |
| // return the menu | |
| return $menu; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment