<?php

$params = array(
	'posts_per_page' => -1, // нужно для отображения всех постов, без разделения по страницам
	'post__in'  => get_option( 'sticky_posts' ),
    'posts_per_page' => 1
);
 
$q = new WP_Query( $params );
 
if ( $q->have_posts() ) : 
    $q->the_post();
    $mainpost_id = get_the_ID();
?>

<div class="main-card">
        
<?if ( has_post_thumbnail() ) :?> 
    <div class="card-img-top">   
        <a href="<?the_permalink();?>"><img src="<?php echo get_the_post_thumbnail_url(null, 'full'); ?>" alt="<?the_title();?>">
        <?if( has_tag( 'видео' ) ):?>
            <span class="play-card"></span>
        <?endif?>
        </a>
    </div>
<?endif?>

<h2 class="main-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
<div class="main-card-body">
    <div class="main-card-text"><a href="<?the_permalink();?>"><?the_excerpt();?></a></div>
    <div class="news_date"><?the_time('j F Y, G:i');?></div>
</div>

</div>




<?php endif; wp_reset_postdata();