WordPress.org

Support

Support » How-To and Troubleshooting » Add a Title Attribute to Anchor Tags

Add a Title Attribute to Anchor Tags

  • Hello,

    I am trying to print a menu using the standard wp_nav_menu function and I want to print the name of the menu item in the anchor tag as well as in the title attribute of the anchor tag.

    So right now I have this:

    <ul>
      <li><a href="#">example</a>
    </ul>

    And I want this:

    <ul>
      <li><a href="#" title="example">example</a>
    </ul>

    Any suggestions on how to do this? I don’t see any solutions in the docs.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add a Title Attribute to Anchor Tags’ is closed to new replies.