how to alter main menu to add custom class How do I add custom class to main menu. The main menu links are like Fashion, Art, Life and nodes being viewed category can be any one. I want to make the main menu item active as per node being viewed category. e.g if example.com/node/44 -> category = fashion then the Fashion in main menu should be selected. I tried MYTHEME_menu_link and MYTHEME_menu_link_alter but they did not work for me.

Thanks for your help.
I can't tell you how this works programatically, but with menu-position module you can achieve exactly what you're looking for. You'll just add a position-rule for your node-types (or taxonomy item used) to highlight a parent item accordingly.