For some reason when I use $link = $item->url now it works.
Instead of $link = get_page_link( $id ).
Related Posts:
- Split up wp_nav_menu with custom walker
- how to create a menu with all sub categories?
- WordPress Menu Custom Walker Class
- How to change order of menu items
- How to use a WordPress’ existing admin icon?
- Add Commas Between Menu Items?
- Allow html tags in WordPress Custom Menus Description Field
- Add custom attribute to menu item link using Filter
- Show child pages by menu order using Superfish Dropdown menu?
- Bootstrap drop down menu with wp_nav_menu
- Remove nav menu or menu item
- Can you have different menus and theme on a per-page basis?
- Adding a within ‘s from wp_nav_menu()
- Building a Sub-menu: Display Parent Category/Page’s Children When Viewing Children
- Getting stripos error when trying to add menu classes
- Custom Walker for Walker_Nav_Menu
- jQuery cookie not working properly in wordpress
- Make compatible custom menu widget for Twitter Bootstrap
- Different side menu on each page
- Automatically generated menu
- Replace menu permalink/hyperlink with only menu name/slug
- Variables within wp_nav_menu
- Admin only menu/page
- wp_update_nav_menu_item not saving in multisite API
- Header style different on home and remaining pages
- Pass GET params to URL from a main menu item
- wp_nav_menu_items filter :: custom menus fall outside ul class
- Schedule Page to Menu [duplicate]
- WP MU: Using pages from main site in other sites’ menus
- How can I add items to the menu via the PHP file?
- Limit the menu child levels under “admin > appearance > menus”
- WordPress warning: “private_to_published” Deprecated when creating nav with wp_update_nav_menu_item()
- display menus on all page except one?
- Show Menu from one WordPress install in another WordPress install
- Check if Page Already Exists in Menu
- Is this format possible with a custom Nav Walker class?
- Add code to WordPress menu items by class
- custom walker nav issue involving ajax
- How to add html attributes to the “ul” html tag with “wp_nav_menu” function?
- Conditional menu display
- Give child-categories same class (the parent category-slug) as parent in menu list?
- How Do I Add Images To Main Navigation Menu
- Wrap list parent in div with wp_nav_menu menu
- How to add a element with walker menu right after begin of the navigation tags?
- Custom Menu not functioning properly
- Using front-page.php need new blog page
- Is it still not possible to show separate submenu with “Custom Menu”?
- Three menus – parent / child / sibling
- WordPress Nav Walker – Top menu link with dropdown link not clickable (dropdown opens)
- Rename the label on a menu location which is already defined?
- How to making dynamic URLs for menus in WordPress?
- Increase wordpress menu Depth
- swap out only main menu for logged in users
- Menu Not Showing on Mobile
- Add custom class to li element which has children
- How to Show Different Menus to Logged in Users in WordPress [duplicate]
- Hide pages from the main menu
- How to customize the built in menu in wordpress?
- Current author archive in navigation menu
- Adding CSS-class to WordPress Menu in backend
- How to change the menu like this?
- Custom ul class
- wp_nav_menu inside an object — how do I deal with fallback_cb?
- How to get or know the slug of home.php
- Removing Submenu from Menu
- Difficulties filtering manage_nav-menus_columns
- How to create menu spread over four lines including images
- Adding conditional classes to wp_get_nav_menu_items
- WordPress menu items automatically becoming empty custom links
- Help with WordPress Custom Nav Walker
- Custom link missing as option in my ‘add menu items’
- Mobile navigation javascript problem
- How can I get back the content of a sub-menu
- Why my dropdown menu is effecting main menu?
- Does the Default theme of WordPress like 2016, 2017 and 2019 uses Walker_Nav_Menu Class
- how to split vertical menu into two columns using walker nav menu
- How to Add Class in
- Get menu items problem
- Can’t add any menu items anymore, server related
- Can’t add optional class to menu item when using Walker_Nav_Menu
- Menu Button that link to different pages for unique user?
- Change “login/register” to “useraccount” when a user has logged in
- Question regarding register_nav_menus();
- How to display list of child pages with parent in wordpress?
- Theme: Twenty Thirteen Mobile Sliding Menu Doesn’t Bump Content Down
- nav_menu: how to force a subpage switching on the parent menu
- wp_dropdown_nav function to list menu items
- Update nav menu item position programmatically
- Navigational error
- Hide page link in main menu from anonymous users
- wp_nav_menu – Collapse with PHP
- How can I disable sorting/dragging of a menu item in the custom menu admin?
- custom walker to add iconfont to wp_nav_menu
- Add monthly archives menu and submenu
- wp nav menu – highlighting current page not working properly [closed]
- Hamburger Navigation Menu
- Active Navigation Class Based on URL on icon
- Rename Menu icon in Twenty seventeen theme
- WordPress Menu – Adding a new dynamic element to the menu
- One item on menu is not clickable when it should be