I need to check if there is an post to be published in future. I want to use WP functions, no directly access to database via mysql_query.
Has anyone some sample of code?
You can use get_post_status() within a query to get future posts.
$args = array( 'post_status' => 'future' );
$my_query = new WP_Query( $args );
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<!-- Do stuff... -->
<?php endwhile; ?>
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
4 years ago