Why do the menu titles change with the renaming of pages?

I’ve created a custom menu using pages. For a lot of the list items, I’ve specified a custom menu title for the page… So, the About Us page becomes About on the menu, for example. Then, when the page title is changed, it’s changing the title on the menu as well. So if I change About Us to About Our Company the menu is getting changed from About to About Our Company.

Is there a way to change the default in WordPress, so those custom menu titles are the default instead of the page name?

From header.php:

<?php 
wp_nav_menu( array(
    'theme_location' => 'primary', 
    'sort_column' => 'menu_order', 
    'container_id' => 'nav', 
    'container' => 'div' 
) ); 
?>

From functions.php:

register_nav_menu( 'primary', 'Primary Menu' );

2 Answers
2

Are you in Appearance > Menus? Is that what you mean by custom menu? Can you share the code you are using to make the menu display? I have this in my header:

wp_nav_menu( array('menu' => 'topnav' ));

Where topnav is the name of my custom menu. You have to add the pages to the custom menu in the “Custom Links” area, if you just use the “Pages” and checkboxes, then it will default to the Page title.

Hope this helps!

Leave a Comment