1

When I open a URL that point to a post which is not published yet, wordpress shows a 404 page. But I want to show a meaningfull message to user that "this post is not published by admin, please contact admin to get it published"

How can I do this?

Edit: Is their any way i can get wordpress to run my single.php template instead of 404 template in my case?

  • Sorry for my asking, but how/why would one get to that page? I mean, how come anyone knows the link to an unpublished (and thus unmentioned/-linked) post? – tfrommen Apr 4 '13 at 9:31
  • @tf Referer from post preview. I get these each day. – fuxia Apr 4 '13 at 10:59
  • Actually in my case user can submit posts from front end and receives link in email. – Ankit Apr 5 '13 at 11:10
0

Try to use this http://codex.wordpress.org/Function_Reference/get_post_status with a simple if statement inside of 404.php or single.php. I don't really know where it will work in that case, it's just an idea.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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