diff --git a/blocks/events.php b/blocks/events.php index 20d08ab..0d5c2e7 100644 --- a/blocks/events.php +++ b/blocks/events.php @@ -1,4 +1,6 @@ 'ASC', 'meta_query' => array(array('key' => 'startevent')), 'post_type' => 'post', - //'post_status' => 'publish, future', + //'post_status' => 'publish', 'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса ) ); @@ -23,8 +25,8 @@ if( $posts ):?> ?>
- ID, 'startevent', true );?> -
+ ID, 'startevent', true );?> +
diff --git a/functions.php b/functions.php index e2e5920..7f81e16 100644 --- a/functions.php +++ b/functions.php @@ -190,6 +190,44 @@ function isContainsRussianLetters($text = false) { return false; } +function eventdate_str($date){ + + +$month = array( + + "01" => "января", + "02" => "февраля", + "03" => "марта", + "04" => "апреля", + "05" => "мая", + "06" => "июня", + "07" => "июля", + "08" => "августа", + "09" => "сентября", + "10" => "октября", + "11" => "ноября", + "12" => "декабря" + +); + + + $findT = strpos($date, 'T'); + + if ($findT){ + $currdatetime = substr($date, 0, $findT); + } + else { + $currdatetime = $date; + } + + $currdate = explode("-", $currdatetime); + + + return $currdate[2].' '.$month[$currdate[1]].' '.$currdate[0]; + + +} + function express_slug($value){