42 lines
995 B
PHP
42 lines
995 B
PHP
<?php $posts = get_posts( array(
|
|
'numberposts' => 4,
|
|
'category' => $category_id, // текущая рубрика
|
|
'orderby' => 'date',
|
|
'order' => 'DESC',
|
|
'include' => array(),
|
|
'exclude' => array(),
|
|
'meta_key' => '',
|
|
'meta_value' =>'',
|
|
'post_type' => 'post',
|
|
'post__not_in' => array($post_id),
|
|
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
|
|
) );
|
|
|
|
# вывод поста
|
|
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?>
|
|
|
|
|