I'm using a modified twentyten theme and want to style the menu item for the currently viewed page different from the rest. I created a menu with a mixture of pages and categories and one custom link for "Home". All of the items are getting the current-menu-item class applied properly except for the Home link.
If anyone can tell me what I might need to change, it would be much appreciated.
Thanks.
This may be a bug. I've discovered it with a default menu widget. .menu-item-home doesn't also get .current-menu-item when on the page defined in that link.
Bradford
Member
Posted 1 year ago #
I found on my site that by including the trailing / it worked. However on another site it isn't working, but that's maybe because there's a bunch of stuff following the url. If you're simply pointing it to your home page include the trailing slash and that might work.
jami0821
Member
Posted 1 year ago #
Adding a trailing slash "/" at the end of the custom menu URL worked for me too.
karlevid
Member
Posted 1 year ago #
seems like you need to use full url with the http://... works for me now.
creativeworldstudio
Member
Posted 1 year ago #
@karlevid - Happy to also confirm adding http://... to the start of the custom link prompts WP to add the correct 'current' and 'ancestor' etc. classes. Thanks!
tonesfrommars
Member
Posted 12 months ago #
I just dealt with this same issue.
I found that not only did I have to add http://..
But also the http://www..
Not sure if the trailing slash was needed or not, but there you go.