Add a class to all the blocks in a region I'm theming a Drupal 7 site and I'd like to add a class to all the blocks in a given region using preprocess_block().

I think this should work, but it doesn't seem to:

function MYTHEME_preprocess_block(&amp;$variables) {
        // Other stuff in this function
        $variables['title_attributes_array']['class'][] = 'title';
        $variables['classes_array'][]='clearfix';

        // Now I want to add a 'col-md-4' class to all the blocks in the 'bottom-content' region
        if($variables['block']-&gt;region == 'bottom-content') {
                $variables['classes_array'][]='col-md-4';
        }
}


Any ideas why this isn't working?
As manikandan kannan is saying, you probably have the name of the region wrong. It probably is: 'content_bottom'

So your if-statement would become:

if($variables['block']-&gt;region == 'content_bottom') { ...