add_filter('wp_nav_menu_items','my_item', 10, 2);
function my_item($items, $args) {
$items .= '<li class="myclass">whatever</li>';
return $items;
}
If you have a specific theme location for menu you can target it with :
if( $args->theme_location == 'mylocation' )
EDIT I
you can try
$items .= '<li class="myclass">' . echo do_shortcode('[shopping_cart]') . '</li>';
but it will work only if the function is available.
About the product No. – I have no idea until I see the code that produces it .
Related Posts:
- How to add specific menu on a specific page or pages
- Inserting a shortcode into a genesis menu?
- start_lvl Ignored in Custom walker_nav_menu
- Hide main div if wp_nav_menu is empty
- Menu Items Disappearing
- wp_delete_auto_drafts() deletes links in menus
- Check if a menu is empty?
- Adding a search form inside a div
- How to remove a metabox from menu editor page?
- Walker class: Problems with understanding how walk() method can be called without error
- How to Use the Function is_user_logged_in To Display Different Menus?
- How to create different menu’s for not logged in visitors and for logged in members?
- How to add active class to custom menu using while loop and wp_list_pages
- How can I access the “description” of a menu item?
- How to place login logout link on menu that redirects users back to current page?
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- How can I add a custom class to only nav sub-menu > li > a items in WordPress?
- items_wrap not working
- Style wp_page_menu() items
- wp nav menu: add attributes to menu items [duplicate]
- Have CSS Class Added with `is_page()` WP function
- Run a filter when a walker runs
- Change Navigation Bar based on logged in or not
- Input type search in Menu
- Change list item content in menu navigation to add a child element with specific class
- How can I Add a variable PHP in the Menu Nav
- Where to place PHP code that inserts (or doesn’t insert) menu item?
- Adding an Avatar to the Top Nav Bar
- Add data attribute to each li in menu
- Remove metabox from WordPress menu editor page?
- How to add an arrow to menu items has submenus
- wp_nav_menu returns menu list in ascending order. How can I arrange the menu same as dashboard menu
- Unique icons next to each WordPress menu item
- Child page menu in sidebar
- Title Case WordPress Menu Items
- Trying to store submenu items to render out after main menu
- get_the_title() gets printed out twice
- Show About and Contact Us page when they’re clicked in the top menu.
- New walker for walker_nav_menu to change inside container data
- Add data-id attribute to child page links
- Parsing Menu Items and Blog Posts
- Add login hyperlink to secondary navigation menu
- wp_nav_menu not working correctly in my underscores theme
- How to display different submenus?
- Notice: Trying to get property of non-object
- How to use wp_nav_menu to create custom dropdown menu?
- Get css class of menu item in custom menu structure
- Randomize Color Scheme Selection in Theme
- Nav-Menu not showing up
- Show login greeting above sub-menu links?
- Why can’t I add a custom image in my navigation?
- How to tell if a user has gone in and created a menu
- Menu not styling. New menus functionality giving me a headache
- Dynamic menu with custom post types
- Add class to ul and li in wp_na
- Adding an Anchor Link to a wordpress menu using WPBakery Page Builder
- Providin exception to WordPress wp_nav_menu Custom CSS Classes
- Adding markup to sub menu based on class
- How to make only the valid active page of a multilevel menu active with – “.nav li.current-menu-item a”?
- Replace jQuery with PHP or CSS for Customized WordPress wp_nav_menu
- dynamic php menu with hidden sub-categories only showing when the category name is clicked
- How to put 2 php codes in functions.php without site crashing
- Menu not updating for logged in users after redirect
- wp_get_nav_menu_items() with ACF
- How to switch between two primary menus (programatically0
- Redirect User when they click Menu Option
- Used a code to revoke some dashboard menus for my contributors but for some reason it’s revoked me access to the editor [closed]
- Replace header with large image on home page only, using Genesis child theme
- How to give custom roles the capability to edit one Menu instead of every Menu
- Primary navigation menu with timed items from custom post type
- Difference between “Walker_Nav_menu” and “walker”
- Add parent menu item in sub-menu in custom nav_walker
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- Vertical Menu for one page only
- Adding custom PHP to existing loop in Genesis
- How limit the width of a fixed menu-bar on scroll?
- Pulling a variable into the wp_nav_menu function
- How to list categories by page id in wordpress
- Two theme locations for two menus, but only one is showing up
- wp_nav_menu doesn’t work in a duplicate server
- How I can add div to menu?
- wp nav menu without label
- Contact form field in wordpress menu
- Add extra markup to WP menus
- How to call a certain object/menubar in a PHP file
- Sidebar current menu item for parent
- Using ‘array’ method in wp_nav_menu causes it to disappear
- Remove all nav menu classes except those which begin with certain letters
- Add the “.current-menu-item” class to tag?
- WP_Nav Highlight Parent Issue
- How to change the menu color
- Can’t remove menu items added by plugin
- if is_home(), change class of menu-item-225 of wp_nav_menu
- Nav Menu Display
- Adding a unique class to wp_nav_menu
- Change order that the menu is generated with wp_list_pages
- I am extending Walker_Nav_Menu: How can I get the number of children elements of the current item?
- How do I modify the with wp_nav_menu()
- Make a permalink to the most recent blog post
- Custom nav with bootstrap dropdown