User unable to see a scheduled post via the url?

My users aren’t able to see scheduled posts. Instead they get shown a 404 error. I’d like to show scheduled posts as well.

Related posts

1 comment

  1. If you want to display the scheduled posts in the main wordpress loop you can use 'post_status' => 'future' as an argument for the array. This will now show your scheduled posts for all users. It’s pretty handy for things like event listings.

    However there is a problem with this and I believe this is what your problem may be. When any user with a role set lower than editor, or a non-user, tries to access that post on it’s individual page you will not have the rights to view it, and it throws up a 404.

    Not sure why this is and why admins and editors can see it.

    If you place this code in your functions.php file it should get it working for everyone.

        /* 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;
    }
    add_filter('the_posts', 'show_future_posts');
    

    I found it from this post on WordPress

    http://wordpress.org/support/topic/display-future-post-on-single-pageview

Comments are closed.