Last active
December 29, 2015 10:29
-
-
Save chrdesigner/7657587 to your computer and use it in GitHub Desktop.
Display posts with 'future' status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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