• Resolved benjammin

    (@benjino)


    How do I remove the title attribute from the main menu links?

    When you hover over the main menu items the title attribute tooltip appears, is redundant and annoying.

    I see the attribute in the html but I don’t know how to remove it. I’ve tried looking through files and just don’t see anywhere it is coming from. I’m guessing some PHP in the functions.php file would turn this off? I’m not a PHP master if that is the answer so any help is appreciated!

    Here is the site in question: Site with issue

Viewing 6 replies - 1 through 6 (of 6 total)
  • If you go to Admin page > Appearance > Menus, and open each menu item, there should be a field for the title attribute. Make this field blank. I tried two themes and they were like this, but its possible your theme is different.

    Thread Starter benjammin

    (@benjino)

    Thank you for responding!

    Yes, I saw all of those things in Appearance > Menus.

    There is a field for Title Attribute but it is blank in all of them.

    The Navigation Label is somehow being output to become the Title Attribute in the HTML <a> tag. This is what I need changed.

    So even though the title attribute is blank in Appearance > Menus it still generates one!

    Um, not so in mine. A blank title attribute in menus gives no title attribute in the link for me. So it could be specific to your setup. Temporarily deactivate plugins and switch themes and test to try to identify which software element is causing this.

    Thread Starter benjammin

    (@benjino)

    I finally found in a PHP file where it is being added and commented out that line of PHP. Now it no longer shows! Your clues were helping me for certain, thanks again.

    Would have been nice if you had said which file you found it in, just so those that follow cold have a n idea where to start looking … oh well guess I’ll just start at the beginning and hunt for it too

    Found it – for me in was in wp_bootstrap_navwalker.php in the ‘framework’ folder in the theme I am using.

    commented out the line which reads:

    $atts['title'] = ! empty( $item->title ) ? $item->title : '';

    so now it reads:

    // $atts['title'] = ! empty( $item->title ) ? $item->title : '';

    this worked for me, hopefully it will give you a way in to finding your solution

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove Title Attribute from Primary Menu Links’ is closed to new replies.