• It appears that “menu-item-home” class is missing from menu item that correspond to the site front page.

    I notived it on one server that is on 4.2.2. So I checked it on another server with older version (I didn’t check the version) and the class was there. However, the class is now missing after I updated it to 4.2.2.

    I don’t know if this is something I’m missing, a spec change or a bug? Is anyone having the same problem or know the cause of it?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter hkonno

    (@hkonno)

    After further experiment, it appears that “menu-item-home” class is added when the Custom Link to the home URL is used but not for the page that is specified as the static front page despite the fact that the menu link is rendered to the same URL.

    I’m not sure how I saw the class on the server that had an older version but it disappeared after the upgrade, since the code relating to adding the class does not have been changed. So, I guess I was mistaken…

    On the other hand, I think the description

    This class is added to menu items that correspond to the site front page

    given for “.menu-item-home” in Function Reference for wp nav menu() is misleading since it sounds as though the class will be added for the menu item for the page that is specified as “Site Front Page”.

    Hey hkonno,

    This was super helpful! Thanks for posting your solution. I was racking my brain to solve this same issue and your follow-up saved me. Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘menu-item-home class missing from wp_nav_menu() result’ is closed to new replies.