Allow contributor to view own scheduled post

You can write your query for listing scheduled posts as follow :
You can see the details here

$the_query = new WP_Query(array( 
    'post_status' => 'future',
    'posts_per_page' => 3,
    'orderby' => 'date',
    'order' => 'ASC'
));

To show the scheduled post on details page you should do something like this
Add code to your theme’s functions.php file. Details can be seen here

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;
}

Leave a Comment