Adding CSS class to flagged node teasers I have tried the following code corolla theme's template.php

/**
 * Implements template_preprocess_node().
 */
function corolla_preprocess_node(&amp;$variables) {
  $flag = flag_get_flag('sold'); // Machine name of your flag.
  if ($flag &amp;&amp; $flag-&gt;is_flagged($variables['node']-&gt;nid)) {
    $variables['classes_array'][] = 'node-flag-sold';
  }
}


This is supposed to add CSS class="node-flag-sold" next to "node". But looking through my firebug, there arenosuch classes added.

Please note, that my node--content-type.tpl.php is custom rewritten.  Do I need to add anything there?
The preprocess code looks reasonably correct.

Make sure you're printing out the $classes variable in your custom node--content-type.tpl.php

e.g, in the wrapper div here:

&lt;div id="node-&lt;?php print $node-&gt;nid; ?&gt;" class="&lt;?php print $classes; ?&gt; clearfix"&lt;?php print $attributes; ?&gt;&gt;

&lt;!-- Node template content ... --&gt; 

&lt;/div&gt;&lt;!-- /.node --&gt;


If curious, $variables['classes_array'] is flattened into $variables['classes'] in template_process with

// Flatten out classes.
$variables['classes'] = implode(' ', $variables['classes_array']);


In D7, process functions are introduced, running after preprocess functions.