Skip to content

Instantly share code, notes, and snippets.

@JiveDig
Created November 9, 2013 05:21
Show Gist options
  • Select an option

  • Save JiveDig/7382036 to your computer and use it in GitHub Desktop.

Select an option

Save JiveDig/7382036 to your computer and use it in GitHub Desktop.
Custom Genesis primary navigation extras
// 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