<?php
if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly

$query = $this->get_query_result();
if ( ! $query->found_posts ) {

    rivax_query_not_found_msg ();

    return;
}
?>
<div class="rivax-stellar-container">
    <div class="rivax-stellar-wrapper">
        <div class="images-wrapper rivax-position-cover">
	        <?php
	        if ( $query->have_posts() ) :
		        while ( $query->have_posts() ) :
			        $query->the_post();

                    $active = $query->current_post == 0 ? ' active' : '';
                    ?>
                    <div class="image-item rivax-position-cover<?php echo esc_attr($active); ?>" data-id="<?php the_ID(); ?>">
                        <?php
                        $thumb_args = [ 'title' => get_the_title() ];
                        if(0 <= $query->current_post && $query->current_post < intval($settings['skip_lazy_loading']) ) {
                            $thumb_args ['loading'] = 'eager'; // Defaults is 'lazy'
                        }
                        the_post_thumbnail($settings['thumbnail_size'], $thumb_args);
                        ?>
                    </div>
                    <?php

		        endwhile;
	        endif;
	        wp_reset_postdata();
	        ?>
        </div>
        <div class="posts-wrapper">
	        <?php
	        if ( $query->have_posts() ) :
		        while ( $query->have_posts() ) :
			        $query->the_post();

			        $active = $query->current_post == 0 ? ' active' : '';
                    ?>
                    <div class="post-item<?php echo esc_attr($active); ?>" data-id="<?php the_ID(); ?>">
                        <?php $this->render_post_body(); ?>
                    </div>
                    <?php
		        endwhile;
	        endif;
	        wp_reset_postdata();
	        ?>
        </div>
    </div>
</div>
