Check whether multiple images are uploaded to a field? Is there a way to check whether or not more than one image is uploaded to a field? I'm working on a custom node template and want a conditional to do x if only one image and y if more than 1.
You can get it done in a few lines using the field_get_items function:

if ($items = field_get_items('node', $node, 'field_name')) {
  if (count($items) == 1) {
    // ...
  }
  elseif (count($items) &gt; 1) {
    // ...
  }
}


It'd be best to keep this logic out of the template file itself and put it in a preprocess function though.