add enddate field
This commit is contained in:
58
category-3.php
Normal file
58
category-3.php
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* The main template file.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
get_header();
|
||||||
|
$nn = 0;?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
|
||||||
|
<ul id="nav_content">
|
||||||
|
<li><a href="<?=get_home_url()?>">Главная</a></li>
|
||||||
|
<li> - <?single_cat_title()?></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h1 class="my-4"><?single_cat_title()?></h1>
|
||||||
|
|
||||||
|
<div class="mini-card-block">
|
||||||
|
|
||||||
|
<?php if(have_posts()) : while(have_posts()) : the_post();?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="mini-card">
|
||||||
|
<?if ( has_post_thumbnail() ) :?>
|
||||||
|
<div class="mini-card-img">
|
||||||
|
<a href="<?the_permalink();?>"><img class="mini-card-img" width="147" style="width: 147px;" src="<?php echo get_the_post_thumbnail_url(null, 'large'); ?>" alt="<?the_title();?>"></a>
|
||||||
|
<?if( has_tag( 'видео' ) ):?>
|
||||||
|
<span class="play-card"></span>
|
||||||
|
<?endif?>
|
||||||
|
</div>
|
||||||
|
<?endif?>
|
||||||
|
<h2 class="mini-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
|
||||||
|
<!-- <div class="mini-card-body">
|
||||||
|
<div class="news_date"><?the_time('j F Y, G:i');?></div>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<?php endwhile;?>
|
||||||
|
|
||||||
|
</div> <!--//end minicard block -->
|
||||||
|
|
||||||
|
<?else:?>
|
||||||
|
|
||||||
|
Здесь пока нет публикаций
|
||||||
|
|
||||||
|
<?php endif;?>
|
||||||
|
|
||||||
|
<?get_template_part( '/blocks/paginator');?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php get_footer(); ?>
|
||||||
@@ -10,7 +10,7 @@ define("COOK_VALUE", "7895");
|
|||||||
define('VIJ_CACHE', ABSPATH.'wp-content/themes/vij/cache/');
|
define('VIJ_CACHE', ABSPATH.'wp-content/themes/vij/cache/');
|
||||||
define('BASE_VIJ', ABSPATH.'wp-content/themes/vij/');
|
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';
|
require get_template_directory().'/src/calend-block.php';
|
||||||
|
|||||||
@@ -5,10 +5,17 @@
|
|||||||
|
|
||||||
function calend_block($month, $year, $script=false){
|
function calend_block($month, $year, $script=false){
|
||||||
|
|
||||||
|
if (strlen($month) == 1){
|
||||||
|
$str_month = "0$month";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$str_month = "$month";
|
||||||
|
}
|
||||||
|
|
||||||
$find_sql = "
|
$find_sql = "
|
||||||
SELECT `post_id`
|
SELECT `post_id`
|
||||||
FROM `wp_postmeta`
|
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){
|
foreach ($posts as $post){
|
||||||
$eventdate = get_post_meta($post['ID'], 'startevent', true);
|
$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]['text'] = $post['post_title'];
|
||||||
$events[$key]['link'] = get_permalink($post['ID']);
|
$events[$key]['link'] = get_permalink($post['ID']);
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class Calendar
|
|||||||
|
|
||||||
$out = '
|
$out = '
|
||||||
<div id="calendar-item">
|
<div id="calendar-item">
|
||||||
<div class="calendar-title">Календарь событий</div>
|
<div class="calendar-title">Календарь мероприятий</div>
|
||||||
<div class="calendar-head">
|
<div class="calendar-head">
|
||||||
<div class="calendar-prev"><a id="calendar-arrow-prev" onclick="load_calendar_month('."'prev'".');"><</a></div>
|
<div class="calendar-prev"><a id="calendar-arrow-prev" onclick="load_calendar_month('."'prev'".');"><</a></div>
|
||||||
<div class="calendar-head-text">' . $months[$month] . ' ' . $year . '</div>
|
<div class="calendar-head-text">' . $months[$month] . ' ' . $year . '</div>
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ require '/vhosts/beta/wp-load.php';
|
|||||||
|
|
||||||
|
|
||||||
if (isset($_GET['month']) and $_GET['year']){
|
if (isset($_GET['month']) and $_GET['year']){
|
||||||
calend_block($_GET['month'], $_GET['year']);
|
calend_block(trim($_GET['month']), trim($_GET['year']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user