# yatra/3.0.13/templates/partials/single-trip/content-gallery.php

Yatra – Travel Booking &amp; Tour Operator Software, version 3.0.13. 60 lines.

- Page: https://pluginprobe.com/plugins/yatra/3.0.13/code/templates/partials/single-trip/content-gallery.php
- Raw: https://pluginprobe.com/plugins/yatra/3.0.13/raw/templates/partials/single-trip/content-gallery.php
- Modified: 2026-05-25T04:28:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/yatra/3.0.13/code/templates/partials/single-trip/content-gallery.php#L10-L20`.

```php
<?php
if (!defined('ABSPATH')) {
    exit;
}
?>
<section class="yatra-trip-section" id="gallery" itemscope itemtype="https://schema.org/ImageGallery">
    <h2 class="yatra-trip-section-title">
        <?php echo yatra_svg_icon('camera', 'yatra-trip-section-title-icon'); ?>
        <?php echo esc_html__('Photo Gallery', 'yatra'); ?>
    </h2>
    <div class="yatra-trip-gallery" data-gallery="hero-gallery">
        <?php
        global $yatra_hero_gallery_images;
        $gallery_images = array_values(array_filter($yatra_hero_gallery_images ?? []));
        if (empty($gallery_images)) :
            ?>
            <p class="yatra-trip-gallery-empty"><?php echo esc_html__('Photos will appear here when this trip has gallery images.', 'yatra'); ?></p>
            <?php
        else :
            foreach ($gallery_images as $index => $image) :
                ?>
                <div class="yatra-gallery-item" data-image-index="<?php echo esc_attr($index); ?>" itemscope itemtype="https://schema.org/ImageObject">
                    <img src="<?php echo esc_url($image); ?>"
                         alt="<?php echo esc_attr(sprintf(
                             /* translators: 1: photo number, 2: trip title. */
                             __('Photo %1$d of %2$s trip gallery', 'yatra'),
                             $index + 1,
                             $trip->getTitle()
                         )); ?>"
                         title="<?php echo esc_attr(sprintf(
                             /* translators: 1: photo number, 2: trip title. */
                             __('Photo %1$d - %2$s', 'yatra'),
                             $index + 1,
                             $trip->getTitle()
                         )); ?>"
                         itemprop="url" content="<?php echo esc_url($image); ?>"
                         data-yatra-src="<?php echo esc_url($image); ?>"
                         data-no-lazy="1">
                    <meta itemprop="contentUrl" content="<?php echo esc_url($image); ?>">
                    <meta itemprop="name" content="<?php echo esc_attr(sprintf(
                        /* translators: 1: photo number, 2: trip title. */
                        __('Photo %1$d - %2$s', 'yatra'),
                        $index + 1,
                        $trip->getTitle()
                    )); ?>">
                    <meta itemprop="description" content="<?php echo esc_attr(sprintf(
                        /* translators: 1: photo number, 2: trip title. */
                        __('Photo %1$d from the %2$s trip gallery', 'yatra'),
                        $index + 1,
                        $trip->getTitle()
                    )); ?>">
                    <meta itemprop="position" content="<?php echo $index + 1; ?>">
                    <meta itemprop="encodingFormat" content="image/jpeg">
                </div>
                <?php
            endforeach;
        endif;
        ?>
    </div>
</section>
```
