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?
- Adding first / last CSS classes to menus
- Display current category title on category page
- Mega Menu Walker
- start_lvl Ignored in Custom walker_nav_menu
- Displaying Logged-In User Name in WordPress Menu
- Hide main div if wp_nav_menu is empty
- Menu Items Disappearing
- Genesis – Customize search form
- wp_delete_auto_drafts() deletes links in menus
- Check if a menu is empty?
- how to put the logo in the center of other items in the navigation bar
- renaming an admin menu item with decimal array index number
- Adding a search form inside a div
- How can I hook into and edit the text of a wp_nav_menu tag?
- 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?
- Replacing a specific menu item
- How to show only parents subpages of current page item in vertical menu?
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- How to create different menu’s for not logged in visitors and for logged in members?
- Can we have a php “page” without a WordPress “page”?
- 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?
- removing tags from wp_list_pages() using PHP
- How to place login logout link on menu that redirects users back to current page?
- wp_delete_auto_drafts() deletes links in menus
- How can I add a class to a single menu item?
- Replacing the NavWalker dropdown element
- StudioPress: add meta tag to every page [closed]
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- WordPress menu deletes when trying to add a hook
- Logout and redirect using the WP Menu
- Remove all nav menu classes ( but keep useful ones… )
- Second Navigation inside header
- Creating new menu item
- Programmatically create menu with custom link
- Custom Loop through category menu to include sub categories
- selected menu item
- 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
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Run a filter when a walker runs
- How to display conditional-content if wp_nav_menu( $args ) retruns something
- Can’t extend some core classes
- Change Navigation Bar based on logged in or not
- Show comments menu in dashboard only if the site has comment
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Count top level menu items
- create a select input with menus created on a custom options page
- Multiple WordPress Menus that will only display all pages
- Menu — How to add “current-menu-grand-ancestor” css class
- Input type search in Menu
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- WP Walker using custom css classes
- Change list item content in menu navigation to add a child element with specific class
- Menu Limitations
- 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
- Automatically adding new post categories to menu
- Add data attribute to each li in menu
- wp_enqueue_scripts leads to error
- Remove metabox from WordPress menu editor page?
- Custom Walker_Nav_Menu issue with variables on PHP 7.3
- 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
- Secondary navigation menu on one page
- Remove class in nav_menu_link_attibutes filter
- Adding function to Genesis genesis_header [closed]
- WordPress Quick Question . How to Get Parent Link in Submenu in My Code
- Trying to store submenu items to render out after main menu
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- How to change menu order item
- Custom Menus: dynamic highlighting problem with custom home link
- get_the_title() gets printed out twice
- Add item to top of menu using a filter in functions.php
- Adding PHP in the menu
- Two menus show up
- Register a menu – Error Header
- How to style one item from main navigation?
- 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
- Automatically add images to a menu
- Use custom template on custom post type
- Add value to new attribute inside WordPress menu items
- wp_nav_menu not working correctly in my underscores theme
- Menu Items fail to save correctly, cause reset of related page metadata