AMP some images not showing up

1.6k Views Asked by At

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 enter image description here

And here is a screenshot from the inspector enter image description here

Same image that works above this non-working one: enter image description here

0

There are 0 best solutions below