File: /var/www/viitorcloud.stgviitor.com/Viitorcloud3.0-wp/wp-content/themes/viitorcloud/archive.php
<?php get_header(); ?>
<?php
$post_types = ['post', 'case_study', 'pov'];
if (is_tax() || is_category() || is_tag()) {
$wp_query = new WP_Query(array(
'post_type' => $post_types,
'paged' => get_query_var('paged') ?: 1,
'tax_query' => $wp_query->tax_query->queries ?? [],
));
}
?>
<?php
$banner_section = get_field('banner_section', 'option');
$master_template = get_field('master_template', 'option');
$sub_page_template = get_field('sub_page_template', 'option');
$banner = $sub_page_template;
$show_cta_as_link = $sub_page_template['show_cta_as_link'];
$button_text = $sub_page_template['button_text'];
$button_url = $sub_page_template['button_url'];
$modal_label = $sub_page_template['modal_label'];
// Breadcrumb
$parent_id = wp_get_post_parent_id(get_the_ID());
$parent_title = $parent_id ? get_the_title($parent_id) : '';
$parent_link = $parent_id ? get_permalink($parent_id) : '';
?>
<div id="main-banner" class="home-banner pb-15 md:pb-0 flex items-end md:items-center relative min-h-100dvh h-100dvh md:min-h-[680px] md:h-[680px]">
<!-- Background Image -->
<?php if (!empty($banner['banner_image']['url'])): ?>
<div class="absolute top-0 left-0 z-[-1] w-full h-full">
<div class="relative w-full h-full">
<img
alt="<?php echo esc_attr($banner['banner_image']['alt'] ?: $banner['banner_title']); ?>"
fetchpriority="high"
decoding="async"
data-nimg="fill"
class="object-cover object-position-banner hidden md:block"
src="<?php echo esc_url($banner['banner_image']['url']); ?>"
style="position: absolute; height: 100%; width: 100%; inset: 0; color: transparent;">
<img
alt="<?php echo esc_attr($banner['banner_image_mobile']['alt'] ?: $banner['banner_title']); ?>"
fetchpriority="high"
decoding="async"
data-nimg="fill"
class="object-cover block md:hidden"
src="<?php echo esc_url($banner['banner_image_mobile']['url']); ?>"
style="position: absolute; height: 100%; width: 100%; inset: 0; color: transparent;">
</div>
</div>
<?php endif; ?>
<div class="container z-[1]">
<div class="grid grid-cols-12">
<div class="col-span-12 xl:col-span-7">
<div class="text-left">
<!-- Breadcrumb -->
<div class="mb-3">
<div class="flex flex-wrap items-center gap-x-1">
<span class="heading xl:text-body6 text-body7 inline-flex items-center">
<a class="text-indigo-800" href="<?php echo esc_url(home_url('/')); ?>">Home</a>
<span class="heading xl:text-body6 text-body7 text-grey-500 mx-2">
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-3 h-3">
<path d="M13.8 9C13.8 9.1 13.8 9.2 13.7 9.3L5.7 17.3C5.5 17.5 5.2 17.5 5 17.3L4.4 16.7C4.3 16.6 4.3 16.5 4.3 16.4C4.3 16.3 4.3 16.2 4.4 16.1L11.4 9L4.4 1.9C4.2 1.7 4.2 1.4 4.4 1.2L5 0.6C5 0.5 5.2 0.5 5.3 0.5C5.4 0.5 5.5 0.6 5.6 0.6L13.6 8.6C13.7 8.7 13.8 8.9 13.8 9Z" fill="currentColor"></path>
</svg>
</span>
</span>
<?php if ($parent_id): ?>
<span class="heading xl:text-body6 text-body7 inline-flex items-center">
<a class="text-indigo-800" href="<?php echo esc_url($parent_link); ?>">
<?php echo esc_html($parent_title); ?>
</a>
<span class="heading xl:text-body6 text-body7 text-grey-500 mx-2">
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-3 h-3">
<path d="M13.8 9C13.8 9.1 13.8 9.2 13.7 9.3L5.7 17.3C5.5 17.5 5.2 17.5 5 17.3L4.4 16.7C4.3 16.6 4.3 16.5 4.3 16.4C4.3 16.3 4.3 16.2 4.4 16.1L11.4 9L4.4 1.9C4.2 1.7 4.2 1.4 4.4 1.2L5 0.6C5 0.5 5.2 0.5 5.3 0.5C5.4 0.5 5.5 0.6 5.6 0.6L13.6 8.6C13.7 8.7 13.8 8.9 13.8 9Z" fill="currentColor"></path>
</svg>
</span>
</span>
<?php endif; ?>
<span class="heading xl:text-body6 text-body7 inline-flex items-center">
<span class="heading xl:text-body6 text-body7 capitalize text-grey-100"><?php single_term_title(); ?></span>
</span>
</div>
</div>
<!-- Title -->
<?php if (!empty($banner['banner_title'])): ?>
<h1 class="heading xl:text-h4 md:text-h5 text-body1 mb-3 font-medium text-white xl:mb-6 md:mb-4">
<?php echo esc_html($banner['banner_title']); ?>
</h1>
<?php endif; ?>
<!-- Description -->
<?php if (!empty($banner['banner_description'])): ?>
<p class="heading xl:text-body5 text-body7 text-white">
<?php echo wp_kses_post($banner['banner_description']); ?>
</p>
<?php endif; ?>
<!-- Mobile CTA -->
<?php if ($show_cta_as_link === 'yes' && $button_text && $button_url): ?>
<div class="block mt-6 xl:mt-10 md:hidden">
<a href="<?php echo esc_url($button_url); ?>"
class="rounded-[6px] transition duration-300 ease-in-out inline-flex items-center hover:text-crayola-900 text-body6 px-6 min-h-[48px] pl-0 mt-4 text-white bg-transparent xl:mt-6">
Talk to expert
<span class="ml-3">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="text-white p-0.5 w-[20px] h-[20px] rounded-full flex justify-center items-center bg-crayola-900 transform rotate-90">
<path stroke-linecap="round" stroke-linejoin="round" d="M4.5 15.75l7.5-7.5 7.5 7.5"></path>
</svg>
</span>
</a>
</div>
<?php elseif ($show_cta_as_link === 'no' && $modal_label): ?>
<div class="block mt-6 xl:mt-10 md:hidden">
<button type="button"
class="cta-btn-modal rounded-[6px] transition duration-300 ease-in-out inline-flex items-center hover:text-crayola-900 text-body6 px-6 min-h-[48px] pl-0 mt-4 text-white bg-transparent xl:mt-6"
data-modal-class="modal">
Talk to expert
<span class="ml-3">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="text-white p-0.5 w-[20px] h-[20px] rounded-full flex justify-center items-center bg-crayola-900 transform rotate-90">
<path stroke-linecap="round" stroke-linejoin="round" d="M4.5 15.75l7.5-7.5 7.5 7.5"></path>
</svg>
</span>
</button>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
<section class="section xl:py-20 py-10 overflow-hidden">
<div class="container">
<?php if (have_posts()) : ?>
<div id="taxonomy-posts-grid" class="flex flex-wrap">
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('template-parts/content', 'card'); ?>
<?php endwhile; ?>
</div>
<?php global $wp_query; ?>
<?php if ($wp_query->max_num_pages > 1) : ?>
<div class="mt-8 text-center">
<button id="taxonomy-load-more-btn"
class="rounded-[6px] inline-flex items-center bg-black-800 text-white px-6 min-h-[48px]"
data-page="2"
data-max="<?php echo $wp_query->max_num_pages; ?>"
data-taxonomy="<?php echo get_queried_object()->taxonomy; ?>"
data-term="<?php echo get_queried_object()->slug; ?>">
Load More
</button>
</div>
<?php endif; ?>
<?php else : ?>
<div class="text-center py-10 md:py-14 lg:py-20 px-4">
<h2 class="text-xl sm:text-2xl md:text-3xl xl:text-h5 mb-3 md:mb-4">
Nothing here yet
</h2>
<p class="text-sm sm:text-base md:text-lg text-gray-600 mb-6 md:mb-8 max-w-2xl mx-auto">
Meanwhile, explore some of our latest insights.
</p>
</div>
<?php
$fallback = new WP_Query(array(
'post_type' => array('post', 'case_study', 'pov'),
'posts_per_page' => 6,
));
?>
<?php if ($fallback->have_posts()) : ?>
<div class="flex flex-wrap justify-center">
<?php while ($fallback->have_posts()) : $fallback->the_post(); ?>
<?php get_template_part('template-parts/content', 'card'); ?>
<?php endwhile;
wp_reset_postdata(); ?>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
</section>
<?php get_footer(); ?>