WP nav menus don’t allow you to paste in HTML directly.
Option 1
Instead, you could create a “Cart” menu item, and use CSS to move the text off the visible page (so screen readers still read it, but sighted visitors don’t see it) and add the icon with an :after. (You can add a custom CSS class to the menu item in wp-admin, and use that to identify which link gets the :after and the text moved.)
Option 2
Or, you could use a custom nav walker, which could check if the current menu item links to the cart, and if so, adds the HTML markup you were originally trying to add.
Option 3
You could use wp_get_nav_menu_items()
(see the Code Reference) to get the items, then use your own custom function to add the HTML markup you were originally trying to add. This might be simpler than the custom walker.
Related Posts:
- Bootstrap Navwalker not displaying
- body_class(); not working with bootstrap navbar fixed top?
- Set custom id to list element walker custom function
- WP Bootstrap Nav (not JS, not missing ID)
- How to add hamburger menu in bootstrap
- WordPress Admin Bar Overlapping Twitter Bootstrap Navigation [closed]
- wp_nav_menu: check if the list item has children and add a class to anchor link
- Add custom meta to nav menu items
- Display navigation menu item conditionally based on user capabilities
- Remember the last post I read
- Export navigation menu
- Main menu not appearing on category pages
- Prev/Next child navigation for current page?
- Multi Level Bootstrap Navigation Menu in WordPress
- List child pages of a specific page
- How to modify the “after” of last element in wp_nav_menu
- How do I retrieve menu items from one level only?
- Edit HTML of WordPress navigation bar
- Using FlexNav with WordPress [closed]
- HTML Bootstrap navigation menu to WordPress menu using wp_nav_menu
- How to make Next and Previous attached image navigation on the attachment page? [duplicate]
- Customizing Walker_Nav_Menu
- Get only the path from a function like previous_post_link
- Break apart wp_list_pages in order to customise it
- Add Bootstrap dropdown class to a nav menu
- Can this navigation be done easily in WordPress?
- Making some links generated from the wp_nav-menu function unclickeable?
- Trouble with wp_nav_menu, conditional tags and fallback_cb
- Make compatible custom menu widget for Twitter Bootstrap
- Previous & Next on Index Page broken
- Using dividers in menu navigation – where to add code?
- Rendering of custom walker menu function not working properly
- Twenty Eleven theme- have custom landing page, change nav “home” link
- Exclude Post Format from next_post and prev_post
- Using query_posts inside single.php loop
- posts_nav_link on single.php
- I need ideas for a complicated menu
- How to get back to same page of post-list – after updating a post
- how to change site tag line for particular pages
- dropdown navigation menu
- Multiple WordPress Menus that will only display all pages
- How to have two menus using Bootstrap nav walker?
- How to add show/hide in navigation setting for pages
- Home Custom Menu Link not Working
- How Do I Add Next and Previous Links On Single Custom Post Type Only?
- Menu with parents, children and or siblings pages display
- Inserting specific images inside navigation menu
- Navigational drop-down lists in WordPress?
- Select first child/subpage item in wp list pages
- Fallback_cb is messing around with containers
- Only show top-level links in site navigation
- Current navigation highlight for a menu that may be modified by the user?
- wp_list_pages to show all pages on all sub pages
- WordPress – Responsive navbar doesnt work
- Adding dropdown box to WordPress menu
- get_adjacent_post – in same term or category not working
- Exclude post format from navigation
- How to make previous_post_link into an image [duplicate]
- How to add swipe action to wordpress pages
- Walker_Nav_menu access parent menu name
- Can I use multiple nav_walkers?
- (Bluehost) navigating to the dashboard via mydomain.com/wp-admin/ results in directory listing
- Implementing the twentythirteen responsive menu in twentytwelve
- Using characters to separate menus in navigation bar
- Exlude pages from wp_list_pages
- How to hide ‘Home’ button from appearing on supages – twenty eleven theme
- reverse next/prev page order
- How to add rel=”nofollow” to wp_list_pages?
- How to list pages with thumbnails, adding a “current-item” class
- Check if current post is the latest (not last)
- How does the Twenty Twelve Navigation Bar work?
- navigation link based on custom field
- How can I add a delay to the collapsible menu in Twenty Eleven?
- Switch form Next/Previous to post title
- add a menu item to navigation menu to link to external url
- Using categories on navigation bar instead of pages
- confused about wp_list_pages() function – how to display selected top pages with all their subpages
- navbar remove box shadow
- Make two bootstrap menus collapse into one dropdown
- Display greyed out nav link when there’s not a next or previous post
- Ussing page_navi with WP_Query
- Ecommerce Single Product Next Product Link
- Top Nav submenus wpon’t stay open – only in FF and only sometimes [closed]
- Display all posts thumbnails when viewing a single post
- Is wp3.8 / twenty fourteen’s Sticky Nav & Responsive – core or theme based
- Setting Up “Split Site” Navigation in WordPress
- Modifying navigation menu classes with a Walker
- Add ID to target navigation link
- New Page Position
- Possible to hide Page if no posts from a CPT?
- Listing Sub-Pages & Sub-Sub-Pages
- navigation doesn’t work in custom header.php
- Next/Previous links doesn’t work in the same category
- WordPress navigation only shows post of page one, even if on page two
- the-events-calendar, pagination with tribe_get_events()
- only show children of a nav menu
- Depth problem using wp_list_pages for subnavigation
- Faceted Navigation in WordPress
- WordPress navigation wont appear with wp_head
- WordPress change wp_nav_menu walker with a custom one