Just paste this script in a post in Edit HTML mode.
<script type="text/javascript">
var password;
var pass1 = "PASSWORD";
password=prompt("Please enter your password to veiw this page!:","");
if (password==pass1) {
window.location= "LINK TO BE OPEN IF PASSWORD IS CORRECT";
} else {
window.location= "LINK TO BE OPEN IF PASSWORD IS NOT CORRECT";
}
</script>
var password;
var pass1 = "PASSWORD";
password=prompt("Please enter your password to veiw this page!:","");
if (password==pass1) {
window.location= "LINK TO BE OPEN IF PASSWORD IS CORRECT";
} else {
window.location= "LINK TO BE OPEN IF PASSWORD IS NOT CORRECT";
}
</script>
Red is the password needed to be typed to access the page.
Green is the link of the post you are using this password script on.
Orange is the page to be taken to if the password entry is incorrect. This can be your homepage or a page of your choosing.
You can Encrypt the code for extra security.
Note: You will need to change the post date of the post you place this code in or it will end up on your homepage and the password lock will bleed through. The idea is to make this the oldest post in your blog so no one will find it. If your blog only has a few post and they are all displaying on the homepage then you can not use this tweak because it will lock all your post. This is more for those pre-established blogs who want to hide a post in the background.
6 comments:
Awesome post! Glad to see you post something again! I love this trick! =D
Thanks! Yeah sorry I been real busy and having a bit of writers block.
I tried it on my blog but it turned that my whole site become password protected. How come the link doesn't work on my specific post only?
Because you added it to your post then left your post on the homepage. Any page your post appears on will have the password lock. You will need to change post date order so the post does not display on your homepage.
im, sorry, but i face the same problem as wow gold..even if i change the post date order, the other page is locked..i only want certain post to be locked..
As I said the idea of this is to make a post where you and a select few can find it. If that is the case then you surly don't want the post on the homepage in the first place. So since you don't want it on the homepage then change the post date to make it the oldest post within your blog. This will stop it from popping up on the homepage. If the only form of navigation on your blog is the next and older button at the bottom of your post then this tweak may not be for you.
Post a Comment
Please don't post hyperlinked text within the comment box! It will not be published and you will be marked as spam.