If the 1st file attached to an item is not an image, for example a pdf file, and 2nd or 3rd file attached is an image, how can I get the thumbnail for that image (1st image)?<?php if (metadata('item', 'has thumnail')): ?>
<div class="item-img"> <?php echo link_to_item(item_image('square_thumbnail')); ?> ?> </div> <?php endif; ?>
The code above will display empty thumbnail if the 1st file attached to the item is not an image. But it could have image(s) attached to it only not the 1st file.
If that is the case, I would like to grab the thumbnail for the first image attached to an item.
Thanks for the helps.