Adaptive Theme

Drupal 7 set active primary menu item first

For a customer project we had the requirements to set the active menu item (if selected) to first of all menu items dynamically.

This was quite tricky, because it was a little hard to find the right hook / theme hook to use. Finally we decided to use theme_preprocess_page within Adaptive Theme.

Here is our code snippet which may help you.