0
我需要显示过去7天内发布的自定义帖子类型的帖子。然后,我会有一个按钮,说未来7天哪些用户可以点击,它会明显显示接下来的7天。显示最近7天与分页的帖子
下面的代码似乎有伎俩。我坚持的一件事是分页,它将如何工作显示接下来的7天?任何提示将非常感谢。
<?php $args = array(
'post_type' => 'properties',
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC',
'date_query' => array(
array(
'after' => '1 week ago'
)
)
); ?>
<?php $propertyInspection = new WP_Query($args); ?>
<?php if ($propertyInspection->have_posts()) : ?>
<?php while ($propertyInspection->have_posts()) : $propertyInspection->the_post(); ?>
<?php the_field('property-address'); ?>
<?php the_field('property-suburb'); ?>
<?php endwhile; ?>
<?php endif; ?>