Remove wordpress post status verification

I need to show all post to all visitors of the site by direct post URL.
I mean if post is not published and user is not logged in in any case anyone can see the post but not 404 page. Where I must perform changes?

Thanks!

Related posts

Leave a Reply

1 comment

  1. You need to add a corresponding query before The Loop. You can use query_posts() for this purpose:

    An example:

    <?php 
    
    global $wp_query;
    $args = array_merge( $wp_query->query, array( 'post_status' => array('publish', 'draft') ) );
    query_posts( $args ); 
    
    ?>
    

    See the Type Parameters documentation here.

    Hope this helps!