<?php
if (!defined('ABSPATH')) {
    exit;
}
$templates = new Chama_Template_Loader;
$campaigns_args = array(
    'post_type' => 'chama_campaign',
    'post_status' => 'publish',
    'posts_per_page' => 1,
    'no_found_rows' => true,
    'orderby' => 'meta_value',
    'meta_query' => array(// phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
        array(
            'key' => 'campaign_end_date',
            'type' => 'DATETIME',
        )),
    'order' => 'ASC',
);
$campaigns_list = new WP_Query($campaigns_args);
?>

<?php
if ($campaigns_list->have_posts()):

    while ($campaigns_list->have_posts()): $campaigns_list->the_post();
        ?>
		        <div class="chama-card left-col">
		        <div class="chama-card-body">
		            <?php
        set_query_var('view_more', true);
        $templates->get_template_part('content', 'campaignsnapshot');
        ?>
		      </div>
		      </div>
		      <?php
    endwhile;
    $campaigns_list = null;
    wp_reset_postdata();
endif;
?>




