WordPress.org

Support

Support » How-To and Troubleshooting » Additional text to active menu item

Additional text to active menu item

  • Hi,

    is there the possibility to add additional markup only to the current menu-item (wp_nav_menu) like in the example beneath?

    The classname “current-menu-item” is added by WP automatically. How could this work with the additonal span-Tag?

    <ul class="nav">
    <li class="menu-item"><a href="">ITEM 1</a></li>
    <li class="menu-item"><a href="">ITEM 2</a></li>
    <li class="menu-item current-menu-item><a href="">ITEM 3 <span class="invisible">now active-item</a></li>
    <li class="menu-item"><a href="">ITEM 4</a></li>
    </ul>

    This is an Web Accessibility thing. Therefore, DOM-Manipulating by JavaScript is no solution.

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Additional text to active menu item’ is closed to new replies.