Skip to content

Instantly share code, notes, and snippets.

@ontiuk
Created January 3, 2017 13:43
Show Gist options
  • Save ontiuk/b6b51d2ffc70970eae3cb9a305a1786c to your computer and use it in GitHub Desktop.
Save ontiuk/b6b51d2ffc70970eae3cb9a305a1786c to your computer and use it in GitHub Desktop.
WordPress Scheduled Posts
<?php
// Set future post status
$args = array(
'post_type' => 'post',
'post_status' => 'future'
);
// Process Query
$scheduled = new WP_Query( $args );
// Posts Loop
if ( $scheduled->have_posts() ) :
?>
<?php while( $scheduled->have_posts() ) : $scheduled->the_post() ?>
<!-- Post Content Here -->
<?php endwhile ?>
<?php else : ?>
<!-- Content If No Posts -->
<?php endif ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment