所以我有一个循环完美的事件,只显示未来的职位。问题是,我希望将帖子不再放在循环中的未来帖子中多一天。WordPress的:只显示将来的职位减去一天
例如: 因此,如果(即定或交)的事件是3日晚上8点。截至目前,它在晚上8点被删除(这是一个问题,因为它可能会持续4个小时)。
我想帖子留了一个额外的一天或时间,我将能够改变。
这里是我当前的代码:
<?php
$args = array('post_type' => 'event', 'posts_per_page' => 50, 'post_status' => 'future', 'order' => 'ASC');
$loop = new WP_Query($args);
if (have_posts()) : while ($loop->have_posts()) : $loop->the_post();?>
<div class="teaser-event <?php the_field('highlight') ?>">
<div class="event-meta gold">
<div class="event-date"><?php the_time('M d'); ?></div>
<div class="event-time"><?php the_time('g:i A'); ?></div>
</div>
<div class="event-title">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
<?php the_title(); ?>
</a>
</div>
</div>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
哇!这看起来很棒,我很感谢快速帮助!这些代码有些超出了我的技能范围,所以我很好奇你是否解释了......和第二代码部分的第二部分。另外,我很好奇,在使用它之前是否需要编辑这些内容? – Reuben 2012-02-16 20:05:15
我删除了'...',第二个代码段是你想用你的代码开始。我不完全确定它是否会起作用。把它放在那里试一下。 – 2012-02-16 20:29:34
好吧,看起来接近!它只显示最后一天内的帖子..我需要这些和未来的帖子:) – Reuben 2012-02-17 02:15:42