<?php

if (! defined('ABSPATH')) {
    exit;
} require PUFFERGO_PLUGIN_DIR . '/templates/data/class-puffergo-cpt-archive-data.php';
$data = PufferGo_CPT_Archive_Data::from_current_query();
$cpt_archive_layout_map = array('puffergo_solution' => 'solution-archive', 'puffergo_case' => 'case-archive', 'puffergo_testimonial' => 'testimonial-archive', );
$layout_id = isset($cpt_archive_layout_map[ $data->post_type ]) ? $cpt_archive_layout_map[ $data->post_type ] : '';
$variant_id = '' !== $layout_id ? PufferGo_Template_Loader::get_active_content_template($layout_id) : '';
$template_file = ('' !== $layout_id && '' !== $variant_id) ? PufferGo_Template_Loader::get_content_template_file($layout_id, $variant_id) : null;
PufferGo_Template_Loader::render_layout_header();

if ($template_file) {
    require $template_file;
} else {
    echo '<main class="puffergo-fullpage-layout"><p>' . esc_html__('Template not found.', 'puffergo') . '</p></main>';
} PufferGo_Template_Loader::render_layout_footer();
