Body classes still showing 'page-node-#' instead of title or menu word I'm trying to get either the title of a page or the menu entry to be listed as a class in the body tag. I came across a posting here utilizing this code:

function THEMENAME_preprocess_html(&amp;$vars) {
  $path = drupal_get_path_alias();
  $aliases = explode('/', $path);

  foreach($aliases as $alias) {
    $vars['classes_array'][] = drupal_clean_css_identifier($alias);
  } 
}


flushed all caches but my body tag still looks like:

&lt;body class="html not-front not-logged-in no-sidebars page-node page-node- page-node-47 node-type-page section-content"&gt;


So instead of that page-node-47, I'd like to see 'about-us' or whatever the path or title of the page is. I guess the path would be a better option for a class name but I'm not picky on that matter right now.

I do have Pathauto and clean urls installed and working. And in my html.tpl, I do have this:

&lt;body class="&lt;?php print $classes; ?&gt;" &lt;?php print $attributes;?&gt;&gt;
I noticed that your function is named THEMENAME_preprocess_html(). If you don't have THEMENAME replaced with the name of your theme, the function won't be called and your classes won't get added.