| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/vhost/cosmicindrani.com/wp-content/themes/indrani/ |
Upload File : |
<?php
/*
Template Name: Gallery Page Template
*/
get_header();
?>
<?php
while ( have_posts() ) :
the_post();
?>
<?php require_once('template-parts/common-hero-section.php')?>
<div class="gallery_wrapper mypy100">
<div class="container maxwidth1150">
<!-- Awards Section -->
<div class="gallery-section">
<h2><i class="fa-solid fa-medal"></i> Awards</h2>
<div class="row">
<?php
// Query for Gems category
$awards = get_posts(array(
'post_type' => 'gallery',
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => 300,
'tax_query' => array(
array(
'taxonomy' => 'gallery-category',
'field' => 'slug',
'terms' => 'awards', // Replace with the actual slug for Gems category
),
),
));
if (!empty($awards)) :
foreach ($awards as $awards) :
$featuredImage = get_the_post_thumbnail_url($awards->ID, 'full');
?>
<div class="col-lg-3 col-md-4 col-sm-6 col-6">
<a href="<?php echo esc_url($featuredImage); ?>" data-fancybox="gallery" data-caption="<?php echo get_the_title($awards->ID); ?>" class="gallery_item">
<img src="<?php echo esc_url($featuredImage); ?>" alt="<?php echo esc_attr(get_the_title($gem->ID)); ?>">
</a>
</div>
<?php endforeach; ?>
<?php else : ?>
<p>No Gallery found in the Awards Category.</p>
<?php endif; ?>
</div>
</div>
<!-- Certificates Section -->
<div class="gallery-section">
<h2><i class="fa-solid fa-award"></i> Certificates</h2>
<div class="row">
<?php
// Query for Gems category
$certificates = get_posts(array(
'post_type' => 'gallery',
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => 300,
'tax_query' => array(
array(
'taxonomy' => 'gallery-category',
'field' => 'slug',
'terms' => 'certificates', // Replace with the actual slug for Gems category
),
),
));
if (!empty($certificates)) :
foreach ($certificates as $certificates) :
$featuredImage = get_the_post_thumbnail_url($certificates->ID, 'full');
?>
<div class="col-lg-3 col-md-4 col-sm-6 col-6">
<a href="<?php echo esc_url($featuredImage); ?>" data-fancybox="gallery2" data-caption="<?php echo get_the_title($certificates->ID); ?>" class="gallery_item">
<img src="<?php echo esc_url($featuredImage); ?>" alt="<?php echo esc_attr(get_the_title($certificates->ID)); ?>">
</a>
</div>
<?php endforeach; ?>
<?php else : ?>
<p>No Gallery found in the Certificates Category.</p>
<?php endif; ?>
</div>
</div>
<!-- Others Section -->
<div class="gallery-section">
<h2><i class="fa-solid fa-trophy"></i> Others</h2>
<div class="row">
<?php
// Query for Gems category
$others = get_posts(array(
'post_type' => 'gallery',
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => 300,
'tax_query' => array(
array(
'taxonomy' => 'gallery-category',
'field' => 'slug',
'terms' => 'others', // Replace with the actual slug for Gems category
),
),
));
if (!empty($others)) :
foreach ($others as $others) :
$featuredImage = get_the_post_thumbnail_url($others->ID, 'full');
?>
<div class="col-lg-3 col-md-4 col-sm-6 col-6">
<a href="<?php echo esc_url($featuredImage); ?>" data-fancybox="gallery3" data-caption="<?php echo get_the_title($others->ID); ?>" class="gallery_item">
<img src="<?php echo esc_url($featuredImage); ?>" alt="<?php echo esc_attr(get_the_title($others->ID)); ?>">
</a>
</div>
<?php endforeach; ?>
<?php else : ?>
<p>No Gallery found in the Others Category.</p>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php endwhile; ?>
<?php get_footer(); ?>