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.

  • 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

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)

| improve this answer | |
  • 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.