0
当我在Wordpress中创建帖子时,我通过名为Post Expirator的插件确定了到期日期。我的问题是,如何在主页,类别等过期时删除这些帖子。如何通过meta_value wordpress删除帖子
此外,我会让所有过期的帖子都显示在我的网站的某个位置。
我试过使用meta_keys和meta_value,但我没有成功。
<?php $args = array(
'meta_key' => '_expiration-date',
);
$query = new WP_Query($args); ?>
<?php if($query->have_posts()) : ?>
<?php while($query->have_posts()) : $query->the_post() ?>
<?php get_template_part('content', get_post_format()); ?>
<?php endwhile ?>
<?php endif ?>
与上面的代码,我可以显示我添加的到期日期,而不考虑其到期日期的,现在想知道我怎么能在一个循环中删除它们的到期日期进行比较的到当前日期。