Fix nav menu active classes for custom post types

By default the Roots Theme highlights custom post type archive menus as well as the “Blog” archive menu buttons. The solution is to remove/replace the “active” classes for those menu buttons, and re-add it to the proper post type’s menu button.

If you created and are using a custom post type in the roots theme, you may have come across a glitch where when you are active on your custom post types archive page (archive-customposttype.php) or single custom post page (single-customposttype.php) the default archive.php (ie. Blog) menu item also may appear highlighted in the main navigation menu (top header menu). This can be quite frustrating, here is a quick fix to add to your functions.php file to fix the menu highlighting problem.

Swap out the menu-item-xxx for you menu item class.

PHP