Fix the home link for custom menu

If you are using WordPress 3.0 custom menu feature, you might have problem to highlight your home link on the homepage, the main reason is the home link missing of “current-menu-item” css class, the primary usage of this “current-menu-item” css class is allow you to style your current link, without this class, your home link will be just behave link your normal menu links.

Here’s the solution , when you adding your current blog’s url as a custom link , you need to add trailing slash to the end of domain, this will resolved the problem and you will find that your home link is display with the “current-menu-item” css class.

I found this bug during customizing my blog theme, to find out what’s wrong with this new feature, I did digging around the code to see what actually causing this.After I found the bug and fixed it , I was trying to send my first patch for WordPress , too bad someone has patched this already and my ticket has been mark as duplicate, I think this is my fault for never check on it.

If there is patch for this bug already why I still blogging about this ? because it doesn’t commit to 3.0.1 patch ,  it will take a while until we receive another update which consist of this patch, so for the time being just add trailing slash to the end of domain will do.

You may also like...