wordpress menu active state

  • Started
  • Last post
  • 1 Response
  • forcetwelve

    how do i make the active menu item highlight in wordpress? i cant seem to get it going through the css.

    ul#menu li a.active, ul#menu li a:hover {
    color: maroon;
    text-decoration: underline;
    margin: 0;
    padding: 0;
    list-style: none;
    list-style-type: none
    }

  • bort0

    Why are you targeting a hover state?

    With a nav comprised of a list of pages, WP will create it's own active class. You just need to target it properly.

    <li>class="page_item page-item-5 current_page_item"</li>

    If you've added your own .active class and it's not working, you're either not targeting it properly, or the class isn't taking. Check your source code from the browser. Is the active state there? If yes, fix your css.