Custom Menus: dynamic highlighting problem with custom home link

I achieved this with some jQuery:

$("#sidebar ul li").each(function () {
     if ($(this).find("a").attr("href") == window.location.href) {
         $(this).addClass("current-menu-item");
     }
});

(My nav is in a div with the id ‘sidebar’, you will need to change the first selector).

It checks if the href of the links is the same as the current URL, and if so, adds “current-menu-item”. You can then style active links with the .current-menu-style class.