new block promo agg
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
<?php $posts = get_posts( array(
|
||||
'numberposts' => 4,
|
||||
<?php
|
||||
|
||||
$yets_params = [
|
||||
|
||||
'numberposts' => 4,
|
||||
'category' => $category_id, // текущая рубрика
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
@@ -8,9 +11,15 @@
|
||||
'meta_key' => '',
|
||||
'meta_value' =>'',
|
||||
'post_type' => 'post',
|
||||
'post__not_in' => array($post_id),
|
||||
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
|
||||
) );
|
||||
|
||||
];
|
||||
|
||||
if (isset($post_id)){
|
||||
$yets_params['post__not_in'] = array($post_id);
|
||||
}
|
||||
|
||||
$posts = get_posts($yets_params);
|
||||
|
||||
# вывод поста
|
||||
if( $posts ):
|
||||
|
||||
Reference in New Issue
Block a user