• Resolved Bubbles

    (@ciaobellaz)


    I’m updating 96 pages, and each page is on 2, in some cases 3, menus. My Navigation Labels are set, and I don’t want them changed, but by default, WP updates Custom Menu Navigation Labels when a page Title is changed.

    Ideally, for future use and in the event I do want to change one or two Nav Titles, I would like to update Nav Labels from Edit Page. If all Nav Labels for any Nav Item are updated when the_title is updated, then surely this is something that is doable.

    • All in One SEO plugin offers this option, and I tried it, but it didn’t work. I’m using Yoast for my SEO and that may have caused a conflict. In any event, I don’t want to switch SEO plugins.
    • Page Menu Editor plugin used to offer this option, but that was a couple years ago and may have been before Custom Menus were native in WP. I did try it though, and it didn’t work.
    • This custom code I came across after a very long Internet search didn’t work.
    • Advanced Custom Fields is promising, but I can’t seem to make it work.

    At the very least, if I can’t update all Nav Labels by updating one field on the Page Edit screen, then I would at least like to disable Nav Labels updating when Page/Post Titles are updated.

    I’ve been searching for the better part of a day, to the point that Google started throwing errors saying my browser appeared to be acting suspiciously and offering CAPTCHAs to get by. I’m an official (exhausted) Bing user now.

Viewing 1 replies (of 1 total)
  • Thread Starter Bubbles

    (@ciaobellaz)

    I resolved my problem by using the tip in this post where @glowingpurplebunny suggested (5 years ago, no less) using a custom field for the page title and then changing my templates entry title code from:

    <h1><?php the_title();?></h1>

    to:

    <?php
    global $post;
    $newtitle = get_post_meta($post->ID,"newtitle",true);
    if ($newtitle): echo "<h1>$newtitle</h1>";
    else: ?>
    <h1><?php the_title();?></h1>
    <?php endif; ?>

    I changed newtitle in the above code to page_headline.

    I’m using Advanced Custom Fields to register the Custom Field page_headline as a text field with no formatting and show the field when Post Type‘s that are pages and posts. The new field is a Standard (WP metabox) field.

    Editing the TITLE in EDIT PAGE still updates the NAV LABEL, but the page itself uses a CUSTOM FIELD for the page’s headline. This essentially solves the problem by making the display headline different than the NAV LABEL without my having to update the menu labels manually every time a page headline changes.

    I’m still using Yoast for SEO, so neither of these changes the SEO title, since I can enter it in the Yoast fields to be the same as either the headline or NAV LABEL or something completely different.

    There was a long and arduous search to find something that worked (and I consider myself a pretty savvy researcher). In case anyone else is looking for resolution to a similar problem, I’m including these search phrases, all of which I used (and more), with hopes others will land on this post:

    • Use custom field for navigation label WordPress
    • Replace navigation label with custom field WordPress
    • Disable the_title replacing navigation label WordPress
    • Stop menu labels updating when the_title changes WordPress
    • Use custom field for page title WordPress
    • Update menu labels from Edit Page WordPress
    • Make menu labels different than page title WordPress (yes, I know how to do this manually, but after hours of searching, I was willing to try anything!)
    • advanced custom fields nav label menu-item-title
Viewing 1 replies (of 1 total)
  • The topic ‘Disable custom menu Nav Labels updating when Page Title changed’ is closed to new replies.