Hi,
I'm pretty new to functions and PHP but here's what I would like to to:
I would like to truncate the title of an article teaser to 48 characters (and preferably follow the truncated title with an ellipsis). I found a code snippet here which I have adapted, but am struggling to ascertain where to insert the code in my Omega subtheme - I've tried sites/all/themes/subtheme/template.php but it seems to have no effect. Please could you share your wisdom with me?

function THEMENAME_preprocess_node(&$variables) {
     if ($variables['type'] == 'article' && $variables['view_mode'] == 'teaser') {
     $variables['title'] = truncate_utf8($variables['title'], 48, TRUE, TRUE);
   } 
}

Thanks!
A~

Comments

Aptalops’s picture

Status: Active » Closed (duplicate)

I'm closing this question because I think it's a display suite issue rather than an Omega one.
Have asked again here: https://www.drupal.org/node/2357179