Lego2012
12/13/2016 - 4:55 PM

Add Extra Code to Primary Menu

Add Extra Code to Primary Menu

.nav-primary .genesis-nav-menu > .right {
    text-transform: none;
    font-style: italic;
    padding: 15px 0;
}
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

/**
 * 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);

<!-- There’s two filters that you can use, depending on how much you know about the menu. wp_nav_menu_items – runs on all menus wp_nav_menu_{menu-name}_items – only runs on that specific menu (ex: wp_nav_menu_primary_items if the menu is named Primary). -->

<!-- http://www.billerickson.net/customizing-wordpress-menus/#extra-code -->