Этот код не возвращает никаких сообщений. Что-то не так с датой? Я думал, что это может использовать дату создания, а не дату публикации.
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'category_name' => 'events',
'orderby' => 'date',
'order' => 'DESC',
'date_query' => array(
'column' => 'post_date',
'after' => 'today',
'inclusive' => true,
),
'posts_per_page' => 3,
'paged' => $paged,
);
$arr_posts = new WP_Query($args);
if ($arr_posts->have_posts()) :
while($arr_posts->have_posts()) :
$arr_posts->the_post();
?>
<div class='event <?php $tags = get_the_tags();
if ($tags) {
foreach( $tags as $tag ) {
echo $tag->name;
}
}?>'
id="post-<?php the_ID(); ?>" >
<h1 class="blue-title"><?php the_title();?></h1>
<div style="display: block;">
<p style="width: 50%; float: left;"><?php the_date(); ?></p>
<p style="width: 50%; float: left; text-align: right;"><?php $tags = get_the_tags(); if ($tags) {foreach( $tags as $tag ) {echo $tag->name . " ";} }?> </p>
</div>
<p><?php the_excerpt(); ?></p>
<a class="right post_link" href="<?php the_permalink(); ?>">Read more</a>
<div style="clear: both;"></div>
</div>
<?php
endwhile;
?>
<?php if (function_exists("pagination")) {
pagination($arr_posts->max_num_pages);
} ?>
<?php else : ?>
<h1>Sorry, there are no events available yes.</h1>
<?php
endif;
?>
Я попытался использовать другую дату в запросе после. Это работает, если я использую первое июня, например.