<?php 
$category = get_queried_object();
$sidebar_class = ['col-lg-8', 'col-lg-4', 'sidebar-right'];
if(isset($category->cat_ID) && vinkmag_term_option($category->cat_ID, 'block_sidebar_layout', 'sidebar-right') == 'sidebar-none'  || !is_active_sidebar('sidebar-right')){
    $sidebar_class = ['col-lg-9 mx-auto', 'hidden', 'sidebar-none'];
}

?>

<!-- post wraper start-->

<?php
    $sticky = get_option( 'sticky_posts' );

    $args = array(
        'post_type' => 'post',
        'posts_per_page' => 3,
        'post__in' => $sticky,
    );
    $query = new WP_Query( $args );
    
    ?>
<div class="grid-slider vinkmag-featured-slider owl-carousel">

<?php while ($query->have_posts()) : $query->the_post(); ?>

<div  class="featured-slider-item" style="background-image: url(<?php echo esc_url(vinkmag_post_thumbnail(get_the_ID(), 'full')); ?>)">
    <div class="featured-table">
        <div class="table-cell">
            <div class="container">
                <div class="row">
                    <div class="col-lg-6">
                        <div class="hero-content">
                            <?php $cat = get_the_category(); ?>
                      
                            <span class="post-tag">
                                <?php $cat = get_the_category(); ?>
                                <a 
                                    href="<?php echo get_category_link($cat[0]->term_id); ?>"
                                    style="<?php echo esc_attr(vinkmag_cat_style($cat[0]->term_id, 'color_only')); ?>"
                                    >
                                    <?php echo get_cat_name($cat[0]->term_id); ?>
                                </a>
                            </span>

                            <h2 class="hero-title">
                            <a href="<?php the_permalink(); ?>">
                                <?php echo esc_html(get_the_title()); ?>
                                </a>
                            </h2>
                        </div>
                    </div>
                    <!-- col end-->
                </div>
                <!-- row end-->
            </div>
            <!-- container end-->
        </div>
    </div>
</div>

<?php endwhile; ?>
</div>

<section class="block-wrapper mt-15 vinkmag-masonary-grid">
    <div class="container">
       <div class="card-columns main-content-inner">
           <?php        $argument = array(
                        'post_type' => 'post',
                        'order' => 'DESC',
                        'orderby'   => 'date',
                        'ignore_sticky_posts' => 1,

                    );
                    $querye = new WP_Query( $argument );
                     ?>
                <?php if ( have_posts() ) : ?>
                        <?php while ($querye->have_posts() ) : $querye->the_post(); ?>
                        <div class="card">
                            <div <?php post_class("grid-md ts-grid-box ts-grid-content"); ?>>
                                <?php if(has_post_thumbnail()): ?>
                                        <div class="ts-post-thumb">
                                            <a href="<?php echo esc_url(the_permalink()); ?>">
                                                    <?php  the_post_thumbnail('full'); ?>
                                            </a>
                                        </div>
                                        <?php
                                        endif;
                                        ?>
                            
                                <?php $cat = get_the_category(); ?>

                                <span class="post-tag">
                                        <?php $cat = get_the_category(); ?>
                                        <a 
                                        href="<?php echo get_category_link($cat[0]->term_id); ?>"
                                        style="<?php echo esc_attr(vinkmag_cat_style($cat[0]->term_id, 'color_only')); ?>"
                                        >
                                        <?php echo get_cat_name($cat[0]->term_id); ?>
                                        </a>
                                </span>
                                <h3 class="post-title">
                                <a href="<?php the_permalink(); ?>"><?php echo esc_html(vinkmag_limited_title(get_the_title(), '20')); ?></a>		
                                </h3>

                            </div>
                        </div>                            
                        <?php endwhile; ?>

				<?php else : ?>
					<?php get_template_part( 'template-parts/blogs/contents/content', 'none' ); ?>
				<?php endif; ?>

        </div>
        <?php if(vinkmag_option('blog_pagination_style','number')=='number'): ?>     
                <?php  get_template_part( 'template-parts/blogs/paginations/pagination', 'style1' ); ?>
        <?php endif; ?>
        <?php if(vinkmag_option('blog_pagination_style','number')=='loadmore'): ?>     
            <?php vinkmag_content_loading(); ?>
        <?php endif; ?>
    </div>
</section>