<?php 

$yets_params = [

    'numberposts' => 4,
	'category'    => $category_id, // текущая рубрика
	'orderby'     => 'date',
	'order'       => 'DESC',
	'include'     => array(),
	'exclude'     => array(),
	'meta_key'    => '',
	'meta_value'  =>'',
	'post_type'   => 'post',
	'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса

];

if (isset($post_id)){
    $yets_params['post__not_in'] = array($post_id);
}

$posts = get_posts($yets_params);

# вывод поста
if( $posts ):

    $nn = 0;?>
    
    
    <div class="yets_rubric"><?=vij_lang('more', LANG_VERSION)?></div>
         
    <div class="yets">
      
        <?php foreach($posts as $post):
            setup_postdata( $post );
            $nn++;?>
    
        <div class="yet_card" id="yets-<?=$nn?>">
            <div class="yet_title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></div>
        </div>   

        <?php endforeach;?>

    </div>

   <?php wp_reset_postdata();

endif?>    


