作者:sdfasdfqg | 来源:互联网 | 2023-10-17 09:11
SoIhavealoopthatrunsperfectforeventsandonlyshowsfutureposts.TheissueisthatIwould
So I have a loop that runs perfect for events and only shows future posts. The issue is that I would love to keep posts that are no longer future posts in the loop for an extra day.
所以我有一个完美的活动循环,只显示未来的帖子。问题是,我希望在循环中保留不再是未来帖子的帖子一天。
Example: So if the event (or post that is scheduled) is for 8pm on the 3rd. As of now it is removed at 8pm (which is an issue because it might last for 4 hours).
示例:因此,如果事件(或计划的帖子)是在3日晚上8点。截至目前,它已于晚上8点被删除(这是一个问题,因为它可能会持续4个小时)。
I would like posts to remain up for an extra day, or time that I would be able to alter.
我希望帖子可以保留一天,或者我可以改变的时间。
Here is my current code:
这是我目前的代码:
'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();?>
2 个解决方案