WordPress showing 404 page template for unpublished posts

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.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)