The WordPress wp_nav_menu function is great. It allows you create and manage your website’s menu via the WordPress admin system.
Something that I think that is really missing by default in wp_nav_menu is having classes defining the first and last menu items. But this can easily be achieved by adding the following code to your theme’s functions.php file:
function add_first_and_last($output) { $output = preg_replace('/class="menu-item/', 'class="first-menu-item menu-item', $output, 1); $output = substr_replace($output, 'class="last-menu-item menu-item', strripos($output, 'class="menu-item'), strlen('class="menu-item')); return $output; } add_filter('wp_nav_menu', 'add_first_and_last');