Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created October 30, 2011 15:01
Show Gist options
  • Select an option

  • Save billerickson/1326002 to your computer and use it in GitHub Desktop.

Select an option

Save billerickson/1326002 to your computer and use it in GitHub Desktop.
Add Extra Code to Primary Menu
<?php
/**
* Add Extra Code to Primary Menu
* @author Bill Erickson
* @link http://www.billerickson.net/customizing-wordpress-menus/
*
* @param string $menu
* @param object $args
* @return string modified menu
*/
function be_menu_extras($menu, $args) {
$extras = '<li class="right">Your extras go here</li>';
return $menu . $extras;
}
add_filter('wp_nav_menu_primary_items','be_menu_extras', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment