add actul dates events

This commit is contained in:
arlemp@selectel.ru
2021-11-05 14:19:49 +03:00
parent 7262b4a43a
commit c42c6c6a40
2 changed files with 10 additions and 2 deletions

View File

@@ -1,5 +1,4 @@
<?php echo calend_block(date('m'), date('Y'), true);
setlocale(LC_ALL, 'ru_RU', 'ru_RU.UTF-8', 'ru', 'russian');
# три последних эвента
@@ -9,7 +8,14 @@ $posts = get_posts( array(
'category' => 61, // 61 - мероприятия
'orderby' => 'meta_value',
'order' => 'ASC',
'meta_query' => array(array('key' => 'startevent')),
'meta_query' => array(
array(
'key' => 'startevent',
'value' => date("Y-m-dTH:i:s"),
'compare' => '>=',
'type' => 'DATE'
),
),
'post_type' => 'post',
//'post_status' => 'publish',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса