i did find my answer here : http://www.wpbeginner.com/wp-themes/how-to-add-custom-items-to-specific-wordpress-menus/
add_filter( 'wp_nav_menu_items', 'your_custom_menu_item', 10, 2 );
function your_custom_menu_item ( $items, $args ) {
if (is_single() && $args->theme_location == 'primary') {
$items .= '<li>Show whatever</li>';
}
return $items;
}
Related Posts:
- Disguise Multi-Page site as Single Page
- How to create menu spread over four lines including images
- Why is my navigation in my onepage not working?
- Navigational error
- Programmatically add a Navigation menu and menu items
- Dynamically exclude menu items from wp_nav_menu
- Split up wp_nav_menu with custom walker
- Is there an easy way to replace a custom menu link with a page or post?
- How to Add to Each Menu Link with link text to data-attr?
- Add Javascript to WordPress Menu
- Filter wp_nav_menu()
- How to modify navigation menu of the “My Account” page in WooCommerce
- Custom ID for certain menu item?
- Add data-icon input to WordPress custom menu links
- Show just one level of child pages, wp_list_pages woe
- Removing link ” from ” menu for some “links” without JS
- Show current navigation path from menu
- Call custom field into menu item
- Use navigation path from menu for permalink
- Exclude Private, Draft pages from Primary Nav when using custom menu
- add span class inside wp_nav_menu link anchor tag
- wp_nav_menu always falls back to a menu
- wp_get_nav_menu_items how to exclude sub level menu items?
- Multi Level Bootstrap Navigation Menu in WordPress
- How to set limit only on top levels of wp_nav_menu?
- Determine if a navigation item has children
- Bootstrap dropdown nav pills not working with wp_nav_menu()
- Show only 2nd level of navigation depending on active navigation
- How to move parent li to end of child ul
- How to get a different mobile menu than desktop menu in the twentytwelve child theme
- Add custom attributes to menu items without plugin
- Add Page ID class to nav menu items
- How to highlight the right item in the navbar
- HTML Bootstrap navigation menu to WordPress menu using wp_nav_menu
- How to manually add an item to a submenu in a menu generated by wp_nav_menu?
- WordPress Export Import Site Navigation Menu
- Using Image Links in WordPress Navigation Menus Instead Of Text Links
- Links open only on new tab or window
- Not able to get current menu ID
- Bar separated navigation by extending Walker_Nav_Menu
- Add class to active top level (grandparent) menu item
- Bar separated navigation by extending Walker_Page
- Replace menu tag with tag
- How to Create a Custom WordPress Navigation Menu with the Code?
- Custom Nav Walker sub-menu HTML construct
- How to get Menu Navigation Labels to output HTML
- custom menu not found
- How to style current page menu item when using a walker
- Adding different classes to anchor in navigation menu
- Number of items in a menu
- wp_nav_menu doesn’t generate parent/ancestor classes
- Add Bootstrap dropdown class to a nav menu
- How to add text before WordPress menu item href
- how to automatically generate hierarchical menus from hierarchy of pages?
- Search box as a menu item in the nav menu output by wp_nav_menu?
- Add an extra field to the navigation menu box?
- Why is ‘nav_menu_item_args’ filter’s $item argument empty?
- WordPress wp_nav_menu with a nav tag
- Add class to menu ul with active child
- How can I put two menus in the same div?
- How do i style the current menu anchor link’s parent anchor link? [closed]
- Does the menu item ID ever change?
- Add sidebars to navigation menu?
- Make compatible custom menu widget for Twitter Bootstrap
- Hide and show menu subpages
- BuddyPress – How to add logout in nav menu
- Second nav is merged with the first in mobile
- How to add a parameter to links in the nav menu?
- `start_el` depth argument in custom nav walker always evaluates to zero
- Benefits of using Nav Walker?
- Use walker for specific menu, or avoid use of walker
- Change where navigation bar links?
- How to display dynamic content in start_lvl function
- Programmatically set current-menu-item using wp_nav_menu
- Nav Walker current menu item not displaying
- Using Shortcodes in WP-Menus in WP 3.1 (via nav_menu_objects)?
- Add custom text to menu
- Menu styling for last menu item
- How to insert custom code into wp_nav_menu structure?
- Page-Linking Structure
- Disable automatig SVG tag from menu
- Navigation (wp_nav_menu) refuses to nest within parent element
- has_children in custom nav_walker
- Menus like a CMS
- How to show Home Page link in WordPress Menu and how to add an icon to this?
- Remove li from wp_nav_menu
- Adding post excerpt into navigation menu
- How to have custom menu Item CSS Classes for wp_page_menu() or wp_list_pages()
- Adding Custom “Current Menu Item” class to navigation?
- Replace menu permalink/hyperlink with only menu name/slug
- wp_nav_menu add some element to container
- Use wp_nav_menu to display ALL pages
- Third level navigation class
- How to fix “Supplied nav_menu_item value missing property” after update to WordPress 5.0
- How to add a submenu toggle button inside all “li” elements that have a submenu?
- get_query_var(‘post_type’) not returning in a filter
- Add custom menu item metabox in Navigation Settings
- Auto add pages to primary menu with functions.php
- Check if menu id = $specific_id – then insert specific
- Get admin menu link