diff --git a/category-3.php b/category-3.php new file mode 100644 index 0000000..a6dab90 --- /dev/null +++ b/category-3.php @@ -0,0 +1,58 @@ + + + + +
+ + + +

+ +
+ + + + + + +
+ +
+ <?the_title();?> + + + +
+ +

+ +
+ + + + +
+ + + + Здесь пока нет публикаций + + + + + +
+ + \ No newline at end of file diff --git a/functions.php b/functions.php index 66fa6fe..e659084 100644 --- a/functions.php +++ b/functions.php @@ -10,7 +10,7 @@ define("COOK_VALUE", "7895"); define('VIJ_CACHE', ABSPATH.'wp-content/themes/vij/cache/'); define('BASE_VIJ', ABSPATH.'wp-content/themes/vij/'); -require '/vhosts/beta/vendor/autoload.php'; +require ABSPATH.'/vendor/autoload.php'; require get_template_directory().'/src/calend-block.php'; diff --git a/src/calend-block.php b/src/calend-block.php index 8b7b54f..b6bc171 100644 --- a/src/calend-block.php +++ b/src/calend-block.php @@ -5,10 +5,17 @@ function calend_block($month, $year, $script=false){ + if (strlen($month) == 1){ + $str_month = "0$month"; + } + else{ + $str_month = "$month"; + } + $find_sql = " SELECT `post_id` FROM `wp_postmeta` - WHERE `meta_key` = 'startevent' AND `meta_value` BETWEEN '$year-$month-01T00:00:00' AND '$year-$month-31T23:59:59' + WHERE `meta_key` = 'startevent' AND `meta_value` BETWEEN '$year-$str_month-01T00:00:00' AND '$year-$str_month-31T23:59:59' "; @@ -54,7 +61,7 @@ function calend_block($month, $year, $script=false){ foreach ($posts as $post){ $eventdate = get_post_meta($post['ID'], 'startevent', true); - $key = date('d.m.Y', strtotime($eventdate)); + $key = date('d.n.Y', strtotime($eventdate)); $events[$key]['text'] = $post['post_title']; $events[$key]['link'] = get_permalink($post['ID']); diff --git a/src/calendar.php b/src/calendar.php index c4e031b..181671f 100644 --- a/src/calendar.php +++ b/src/calendar.php @@ -31,7 +31,7 @@ class Calendar $out = '
-
Календарь событий
+
Календарь мероприятий
' . $months[$month] . ' ' . $year . '
diff --git a/src/eventcalendar.php b/src/eventcalendar.php index e5a2e06..5548b16 100644 --- a/src/eventcalendar.php +++ b/src/eventcalendar.php @@ -9,6 +9,6 @@ require '/vhosts/beta/wp-load.php'; if (isset($_GET['month']) and $_GET['year']){ - calend_block($_GET['month'], $_GET['year']); + calend_block(trim($_GET['month']), trim($_GET['year'])); }