Dynamic menu highlighting with WordPress menus (3 posts)

  1. blicht454
    Posted 4 years ago #


    I'm using a menu that I created on the backend under appearance > menus. The menu is functioning properly, but I'm just wondering how I can echo a "current" class for each page / menu item. Because I haven't input the links myself, I don't know how to access them.

    Any ideas?

    Thank you.

  2. Peter Wooster
    Posted 4 years ago #

    The system adds the class current-menu-item to the li containing the menu item.


  3. Odenberg
    Posted 4 years ago #

    I just did that. I put
    li.current-menu-item a {background: black; }
    in my themes css.

Topic Closed

This topic has been closed to new replies.

About this Topic