Skip to content

Instantly share code, notes, and snippets.

@chrdesigner
Last active December 29, 2015 10:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrdesigner/7657587 to your computer and use it in GitHub Desktop.
Save chrdesigner/7657587 to your computer and use it in GitHub Desktop.
Display posts with 'future' status
<?php
add_filter('the_posts', 'show_future_posts');
function show_future_posts($posts)
{
global $wp_query, $wpdb;
if(is_single() && $wp_query->post_count == 0)
{
$posts = $wpdb->get_results($wp_query->request);
}
return $posts;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment