new block promo agg
This commit is contained in:
@@ -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 );
|
||||
|
||||
# вывод поста
|
||||
|
||||
|
||||
5
blocks/promo-agregators.php
Normal file
5
blocks/promo-agregators.php
Normal 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>
|
||||
@@ -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