-1

This question already has an answer here:

I made my published post as draft post. It is not showing it in the website blog, but, when i use its URL it is showing "Error 404 - Not Found". but what i want is to show the content of draft post when the URL is given in the browser.

marked as duplicate by Nicolai, Brad Dalton, Howdy_McGee, Robert hue, TheDeadMedic Aug 6 '15 at 9:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Please be specific and do not change the question and scope of the question to fit your needs after someone has answered your originally posted question. This is not how it works. – Pieter Goosen Jul 30 '15 at 8:57
0

You need to change into the code, by default wordpress shows only post which are published. In your case you need to change the

$args = array(
    'post_status' => array( 'publish', 'draft')
);
$query = new WP_Query( $args );

for more info you can look into this link:

Another thing you can alter your current query using query post like query_posts(&post_status=draft)

  • This won't work, your main query will still 404 regardless. And never ever use query_posts, it breaks the main query object which break all plugins anf functions that relies on the main query object – Pieter Goosen Jul 30 '15 at 8:17
  • Yes, @PieterGoosen query_post is never recommend, that's why I not explain this. :) – Hari Om Gupta Jul 30 '15 at 8:50
  • Yes, @PieterGoosen your ans is exact ans, I just try to lead him into the direction. :) – Hari Om Gupta Jul 30 '15 at 8:52
  • sorry, but I have mentioned the same requirement in the question. – johndeep Jul 30 '15 at 10:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.