我目前有一些代码设置来显示管理员根据事件日期设置的即将发生的事件。即将到来的事件按下一个即将到来的事件进行排序,从顶部开始,然后向下。我把它限制在两个以内。
但是,当一天开始时(例如,事件日期的午夜),事件就会消失。I\'d like the event to still show through midnight of the next day (e.g. the start of the next day). 现在,事件发生的第二天,事件正在消失。。。
有人知道如何用我现有的代码来更改吗?
<div class="boxer events">
<h3>Upcoming Events</h3>
<?php
//The Query
query_posts(array(
\'posts_per_page\' => 2,
\'meta_key\' => \'event_date\',
\'meta_value\' => date(\'Y-m-d\'),
\'meta_compare\' => \'>\',
\'orderby\' => \'meta_value\',
\'order\' => \'ASC\'
));
//The Loop
$count = 0;
while ( have_posts() ) : the_post(); $count++;
//The Title
$title = $post->post_title;
$event_datee = get_post_meta($post->ID, \'event_date\', true);
?>
<dl>
<dt><a title="<?php echo $title; ?>" href="<?php the_permalink(); ?>"><?php echo $title; ?></a></dt>
<div class="postdate">
<div class="month m-<?php $dtes = get(\'event_date\'); $timestamp = strtotime($dtes); echo date(\'n\', $timestamp); //month ?>"></div>
<div class="day d-<?php $dtes = get(\'event_date\'); $timestamp = strtotime($dtes); echo date(\'d\', $timestamp); //day ?>"></div>
<div class="year y-<?php $dtes = get(\'event_date\'); $timestamp = strtotime($dtes); echo date(\'Y\', $timestamp); //year ?>"></div>
</div>
<dd><?php the_excerpt(); ?></dd>
</dl>
<?php endwhile; ?>
</div><!--end boxerevents-->
谢谢你的帮助!