I have a list of images which appear in a loop based on switch case, here is the code:
if (get_field('sentiment_result') != "") {
switch($a) {
case 'up':
$label = __('Bullisch');
$img = 'bullish';
break;
case 'down':
$label = __('Bärisch');
$img = 'bearish';
break;
case 'not-valued':
$label = __('Not valued');
$img = 'not-valued';
break;
default:
return '';
break;
};
echo '<div class="sentiment">
<amp-img layout="responsive" height="50" width="50" src="'.get_bloginfo ('template_directory').'/assets/img/sentiment/'.$img.'.png" alt="' . $img . '"></amp-img>
Everything is working fine except for some images, on the frontend I can see all the list with images except for some, even though the same images appears on some posts above. Here is a screenshot