How to add an html element (BODY) class based on taxonomy from logged in user? I'm building a website on Drupal 7 which will be accessible only to registered users. A taxonomy term is referenced to the user account. I need to add a body class based on that taxonomy term so I can personalize the theme's look depending on the logged in user.
In your custom module implement hook_preprocess_field().In the given code I am adding a taxonomy term field with uid as class,you can change to your requirement.

function mymodulename_preprocess_field(&amp;$variables) {
  global $user
  if($variables['element']['#field_name'] == 'your_taxonomy_term_name') {
    dpm($variables);
    dpm($variables['classes_array']);
    $variables['classes_array'][] = $user-&gt;uid;
  }
}