Tag Info

Hot answers tagged

2

WordPress menus are their own Post Type ( nav_menu_item ). Every time you add a new item to a menu it create a new "post" in the nav_menu_item post type and assigns it a new ID just as deleting and recreating a page removes / adds new ids. This means the only way the Navigation Item ID will change is if the item is removed from the Menu. You'll never have ...


2

As i got the solution so i am posting it here. Wordpress uses current-menu-ancestor and current_page_ancestor classes. So we can use them as below .mainmenu .current_page_item > a, .mainmenu .current_page_ancestor > a, .mainmenu .current-menu-item > a, .mainmenu .current-menu-ancestor > a { font-style: italic; }



Only top voted, non community-wiki answers of a minimum length are eligible