How to print user role in body profile page I've got two roles in my website and I'd like to print the role name in the user profile page body classes for the user being viewed. How can I do this?
The html.tpl.php template uses the $classes variable to add classes to the body element. You can use template_preprocess_html() to add classes to this variable. Add this function to your theme's template.php 

//Replace MYTHEME with the name of your theme
function MYTHEME_preprocess_html(&amp;$variables) {

  //Check if the path is a profile page with a valid user
  if(preg_match('/^user\/(\d+)/', current_path(), $matches) == 1) {
    if($user = user_load($matches[1])) {

      //Add each role to the $classes_array which makes it available in $classes
      foreach($user-&gt;roles as $rid =&gt; $role) {
        $variables['classes_array'][] = str_replace(' ', '-', $role);
      }
    }
  }
}