add menus

This commit is contained in:
2021-09-18 01:30:09 +03:00
parent 5a50fb1a94
commit d9c6a87cfe
11 changed files with 350 additions and 29 deletions

34
blocks/events.php Normal file
View 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;