I am using the amely theme and overridden the code, The images which I display on thumbnail somehow the first images come at the end.

I am not able to figure out why this is happening.

<div id="vertical-thumbnail-wrapper">
    <div id="vertical-thumbnail" class="vertical-thumbnail">
        <?php $i = 0; foreach($galleryImages as $image): ?>
            <?php $lbImage = $image->getLabel() ? $image->getLabel() : $image->getLabelDefault(); ?>
            <div class="item-thumb<?php if($i == 0): ?> active<?php endif ?>" data-owl="<?php echo $i ?>">
                <img class="img-fluid" src="<?php echo $image->getSmallImageUrl(); ?>" alt="<?php echo $productHelper->getAltImageText($this->getProduct()) ?>"/>
                <?php if($image->getMediaType() == 'external-video'): ?>
                    <div class="popup-video-thumb"><span class="ti-video-camera"></span></div>
                <?php endif ?>
            <?php $i++; ?>
        <?php endforeach ?>

enter image description here

The marked image should be at first and even the url tells that it is the first image.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.