42 lines
922 B
PHP
42 lines
922 B
PHP
<?php echo calend_block(date('m'), date('Y'), true);
|
|
|
|
# три последних эвента
|
|
|
|
$posts = get_posts( array(
|
|
'numberposts' => 3,
|
|
'category' => 61, // 61 - мероприятия
|
|
'orderby' => 'date',
|
|
'order' => 'ASC',
|
|
|
|
'date_query' => array(
|
|
array(
|
|
'after' => '3 days ago',
|
|
),
|
|
),
|
|
|
|
'post_type' => 'post',
|
|
'post_status' => 'publish, future',
|
|
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
|
|
) );
|
|
|
|
# вывод поста
|
|
if( $posts ):?>
|
|
|
|
<div id="events_left">
|
|
|
|
<?foreach($posts as $post):
|
|
setup_postdata( $post );
|
|
?>
|
|
|
|
<div class="event">
|
|
<div class="news_date"><?the_time('j F Y');?></div>
|
|
<a href="<?php the_permalink(); ?>"><?php the_title();?></a>
|
|
</div>
|
|
|
|
<?php endforeach;?>
|
|
|
|
</div>
|
|
|
|
<?wp_reset_postdata();
|
|
|
|
endif;
|