new block promo agg

This commit is contained in:
2023-12-15 16:52:30 +03:00
parent 19a7e3f4a1
commit 44ef31d4eb
9 changed files with 127 additions and 22 deletions

View File

@@ -1,14 +1,20 @@
<?php
$more_posts = get_posts( array(
'numberposts' => 6,
$more_params = [
'numberposts' => 6,
'category' => 61, // пока тольео события
'meta_key' => 'startevent',
'meta_value' =>'',
'post_type' => 'post',
'post__not_in' => array($post_id),
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
];
if (isset($post_id)){
$more_params['post__not_in'] = array($post_id);
}
$more_posts = get_posts( $more_params );
# вывод поста

View File

@@ -0,0 +1,5 @@
<div class="promo-agregators">
<p>Свежие отраслевые новости на нашем канале в <span class="promo-telega"><a href="https://t.me/ViZHuvizh" target="_blank">Telegram</a></span></p>
<p>Добавьте «Ветеринарию и жизнь» в избранное в <a href="https://yandex.ru/news/?favid=254162793" target="_blank"><span class="promo_ya"></span><span style="font-weight: bold; color:black;">ДЗЕН.НОВОСТИ</span></a></p>
<p>Подписывайтесь на канал «ВиЖ» в <b><a href="https://zen.yandex.ru/id/5ee3cb4d4954b90c587dec79" target="_blank"><span style="font-weight: bold; color:black;">ДЗЕН</a></b></p>
</div>

View File

@@ -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 ):