34 lines
783 B
PHP
34 lines
783 B
PHP
<?php
|
|
|
|
# три последних эвента
|
|
|
|
$posts = get_posts( array(
|
|
'numberposts' => 3,
|
|
'category' => 44, // 44 - мероприятия
|
|
'orderby' => 'date',
|
|
'order' => 'DESC',
|
|
'include' => array(),
|
|
'exclude' => array(),
|
|
'meta_key' => '',
|
|
'meta_value' =>'',
|
|
'post_type' => 'post',
|
|
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
|
|
) );
|
|
|
|
# вывод поста
|
|
if( $posts ):
|
|
|
|
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;
|
|
|
|
wp_reset_postdata();
|
|
|
|
endif;
|