You should change this line:
echo "post_parent)."\">".get_the_title($post->post_parent) . "";
To something like this:
echo '<a href="'. get_permalink($post->post_parent).'">'. apply_filters('the_title', get_the_title($post->post_parent)) .'</a>';
Related Posts:
- Get the ID of the page a menu item links to?
- Breadcrumbs showing Parent and Child Pages
- Slugs as breadcrumbs for Pages
- Make menu structure match page heirarchy on page parent change
- Modify sub_menu function to show pages below a specifically set page
- How to add a class name to the ancestor of a post?
- How to add a data attribute to a WordPress menu item
- Issues with title-tag and document_title_parts
- Apply the_title() filter in post & page title, but not in menu title
- Add container to nav_menu sub menu
- Change the_title() of a page dynamically
- Get menu object from theme_location
- Remove Container Element From wp_nav_menu() Markup
- How to target specific wp_nav_menu in function?
- Return only top-level navigation items from a menu using wp_get_nav_menu_items
- Check if has any sidebar active on current page
- Remove Page Title from Static Frontpage
- How to activate “Description” metabox for menu item programmatically?
- Dynamically add sub-categories to any category in the menu
- Target a certain page within wordpress backend (admin) i.e. Pages > About
- automatically adding submenu items
- Unregister Nav Menu with fallback?
- How to programmatically set a menu to be the Primary Menu?
- Pages should have priority when using add_rewrite_rule
- Enqueuing Script in functions.php vs on the page
- Delete pages and Create default pages for all new network sites
- how to change link of some wordpress pages
- Change the slug of a particular page every x hours
- wp_insert_posts keeps adding multiple pages
- Is there a way to add a class to non current menu item?
- Logout hyperlink within a sub-menu
- Menu fallback “menu_class” rendering a “div” instead of a “ul”
- is_account_page() change to page slug
- Why does the ‘wp_nav_menu’ function work only until a menu is created?
- Don’t delete a page if it holds users
- How to show only one category in breadcrumb navigation
- How to add nav menu items to a specific position within a menu
- Hard coded main navigation
- List all-childpages on parent-page AND list child-pages on childpage itself but not the current one?
- Hard-coding custom menu elements for menu manager
- Display post shortcode content in the sidebar?
- Function only on a specific page
- Is possible add icon in title posts only in specific tag?
- Custom Nav Walker sub-menu
- How to fetch the name of the active menu?
- Replace a menu with widget or a custom template file programmatically
- Get page id or status by private pages?
- Categories as main menu items and subcategories as nested lists
- Removing specific menu items?
- What is the text that appears beside the page titles in the list of pages in the WP admin?
- disable Tab post on nav-menus page (Admin)
- How do I hook into the container of wp_nav_menu?
- New custom menu created. how to apply it?
- Filter nav menu items HTML tags and wrap inner text with span
- retrieves menu and converts it to a readable array
- Nav menus all outputting the same links
- Secondary Menu and Logged In Users
- Change menu based on page template via functions.php
- Show some menu sub items as dropdown under a menu item
- How to add custom li item to wordpress menu
- Add Login/Logout Menu Item to Primary Nav “My Account” Submenu [Woocommerce] [closed]
- Default Nav Highlight
- add_theme_support( ‘title_tag’ ) is not showing title on index.php
- why is this function firing on all child menu items as well?
- Adding a section in line at the end of the main navigation menu in php
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- Multiple navigation menu in same location
- How do I register a new settings page? [closed]
- wp_nav_menu work in functions.php but not in the theme
- How to register a menu based on a ACF condition
- Only echo Page Content (not page title & page content together)
- current_page_item is missing inside wp_nav_menu
- Unable to add extra elements to the main navi (wp_nav_menu_items)
- get content from page through AJAX
- Custom Menu in Admin doesn’t change menu in browser
- Catagorized hierarchy menu for PAGES!
- Conditional custom menu?
- wp_nav_menu displaying all pages
- How to assign php file(template) to several pages with same prefix page name/slug
- Warning at top of website & top menu gone
- How to display an image before title text in menu items
- Change Page Title
- Bizarre Child Menu Issue on WP Site
- Header menu aligned right on all pages except for single-post page [closed]
- How to automatically add counted number to navigation menu items?
- Parent category as WOOCommerce Categories widget title
- Menu and category highlighting for a single post
- WordPress Toggle Menu has stopped working
- Remove the delete link from pages without a plugin
- How to add widget in main menu
- Language Switch Function
- Custom field not updating via functions upon publishing
- wp_nav_walker that interacts with widgets to setup mega menu
- Force changing the Site Title and add link
- How can I change the title of the Home link in the navigation bar?
- Function Reference for custom link in Admin Menu Management Page
- How to add an excerpt and read more link to a page?
- Why don’t ‘wp_nav_menu’ CSS classes work until a menu is created?
- Call wordpress function through functions.php when pressing menu
- How to add more than one menu for logged in members?