2023-03-27 23:26:09 +03:00
|
|
|
<?php
|
|
|
|
|
|
2023-12-15 16:52:30 +03:00
|
|
|
|
|
|
|
|
$more_params = [
|
|
|
|
|
'numberposts' => 6,
|
2023-03-27 23:26:09 +03:00
|
|
|
'category' => 61, // пока тольео события
|
|
|
|
|
'meta_key' => 'startevent',
|
|
|
|
|
'meta_value' =>'',
|
|
|
|
|
'post_type' => 'post',
|
2023-12-15 16:52:30 +03:00
|
|
|
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
if (isset($post_id)){
|
|
|
|
|
$more_params['post__not_in'] = array($post_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$more_posts = get_posts( $more_params );
|
2023-03-27 23:26:09 +03:00
|
|
|
|
|
|
|
|
# вывод поста
|
2023-03-28 12:36:23 +03:00
|
|
|
|
2023-03-27 23:26:09 +03:00
|
|
|
if( $more_posts ):
|
|
|
|
|
$nr = 0;?>
|
|
|
|
|
|
|
|
|
|
<div class="moread_rubric">Другие мероприятия:</div>
|
|
|
|
|
|
|
|
|
|
<div class="moread">
|
|
|
|
|
|
|
|
|
|
<?php foreach($more_posts as $post):
|
|
|
|
|
$nr++;
|
|
|
|
|
setup_postdata( $post );?>
|
|
|
|
|
|
|
|
|
|
<div class="moread_card" id="moread_<?=$nr?>">
|
|
|
|
|
<?$imgurl = IMGSERVER.'news/512x340/'.str_replace('https://vetandlife.ru/wp-content/uploads/', '', get_the_post_thumbnail_url($post, 'full'))?>
|
|
|
|
|
<img src="<?php echo $imgurl;?>" alt="<?the_title();?>">
|
|
|
|
|
<div class="moread_title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></div>
|
2023-03-28 13:49:42 +03:00
|
|
|
<?setlocale(LC_TIME, 'ru_RU.utf8');?>
|
|
|
|
|
<?$startevent = strtotime( get_post_meta($post->ID, 'startevent', true) );?>
|
|
|
|
|
<div class="moread_date"><?=date_i18n( 'j F Y', $startevent );?>
|
|
|
|
|
</div>
|
2023-03-27 23:26:09 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<?php endforeach;?>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<?php wp_reset_postdata();
|
|
|
|
|
|
|
|
|
|
endif?>
|