add menus
This commit is contained in:
34
blocks/events.php
Normal file
34
blocks/events.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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;
|
||||
Reference in New Issue
Block a user