<div class="gt-blog-content-3">
    <?php
        if ( $query->have_posts() ) {
        $i = 0;
        while ( $query->have_posts() ) {
        $query->the_post();
            $tags = get_the_tags(get_the_ID());
            $categories = get_the_terms( get_the_ID(), 'category' );
            $i++;
    ?>
    <div class="gt-blog-item-3 txt_item_active d-flex align-items-center wow fadeInUp"  data-wow-delay="300ms" data-wow-duration="1200ms">
        <?php if($i%2 != 0):?>
        <?php if(has_post_thumbnail()):?>
            <div class="blog-img">
                <?php the_post_thumbnail( 'goyto-img-size-4' );?>
            </div>
        <?php endif;?>
        <?php endif;?>
        <div class="blog-text headline pera-content align-items-center justify-content-between">
            <div class="blog-title-meta d-flex align-items-center">
                <div class="blog-meta d-flex align-items-center justify-content-center">
                    <div class="inner-text text-center text-uppercase">
                        <span><?php echo get_the_date('d') ?></span>
                        <span><?php echo get_the_date('M') ?></span>
                    </div>
                </div>
                <div class="blog-title">
                    <h3 class="blog_title wow" data-splitting=""><a href="<?php the_permalink()?>"><?php echo wp_trim_words(get_the_title(), $settings['title_length'], '')  ;?></a></h3>
                </div>
            </div>
            <div class="author-meta mt-15">
                <a href="#"><i class="far fa-user"></i> <?php echo esc_html('by', 'goyto-plugin');?> <?php the_author()?></a>
                <a href="#"><i class="far fa-comment"></i><?php echo esc_attr(get_comments_number()); ?> <?php echo esc_html('Comments', 'goyto-plugin');?></a>
            </div>
            <p><?php echo wp_trim_words(get_the_excerpt(), $settings['excerpt_length'], '')  ;?></p>
            <?php if(!empty($settings['button_label'])):?>
                <div class="gt-btn-2 btn-spin mt-40">
                    <a href="<?php the_permalink()?>"><?php echo esc_html($settings['button_label']);?></a>
                </div>
            <?php endif;?>
        </div>
        <?php if($i%2 == 0):?>
        <?php if(has_post_thumbnail()):?>
            <div class="blog-img">
                <?php the_post_thumbnail( 'goyto-img-size-4' );?>
            </div>
        <?php endif;?>
        <?php endif;?>
    </div>
    <?php } wp_reset_query(); } ?>
</div>