How can I theme a single value from a multi-value theme? I'm trying to output a single piece of text from a multi-value text field (unlimited # of values) in my node template and I can't for the life of me figure out how to do it AND apply the THEME to it.

If I just do this:

render($content['field_hero_slideshow_header_text'][0])


I get the plain old markup for the field. However I want it to be run through the filters and have the theme template applied to it just as if I were rendering the full field with all the values like so:

render($content['field_hero_slideshow_header_text'])


I've tinkered with passing the #theme values and other vars to the array and using the theme() function also. but I can't quite seem to get it. What am I missing?
It seems like there are properties in $content['field_hero_slideshow_header_text'] which determine how it's themed. Perhaps a '#theme'.

Can you try making a copy of the entire field with just the value you want?

$content['field_hero_slideshow_header_text_copy'] = $content['field_hero_slideshow_header_text'];

// Unset all multi values, they have integer keys.
foreach($content['field_hero_slideshow_header_text_copy'] as $k =&gt; $v) {
  if (is_int($k)) { unset($content['field_hero_slideshow_header_text_copy'][$k]; }
}

// Add just the one we want back in.
$content['field_hero_slideshow_header_text_copy'][0] = $content['field_hero_slideshow_header_text'][0];

// Output single field.
render($content['field_hero_slideshow_header_text_copy']);

// Do you need to remove the field from the original array?
unset(render($content['field_hero_slideshow_header_text'][0]);


Not the nicest way I know. You could try copying properties from the parent to the child and it might output correctly, though I don't think so because the theme function probably expects data in a parent > child format.