- This topic has 3 replies, 2 voices, and was last updated 12 years, 8 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember Troubleshooting › Partial page lock with a custom password (all users – members or not)
Hi,
I want to lock part of my content with a password.
I want to let visitors see the content only after submitting a password without any relation with them being members of the site or not.
Is it possible?
Thanks
Oren
Can’t find anything
Found this WP built-in solution (No plugin needed):
Instructions
For WordPress 2.0 or 2.1, open /wp-includes/template-functions-post.php
For WordPress 2.2 through 2.8+, open /wp-includes/post-template.php
Find the following text:
$output = get_the_password_form();
return $output;
Replace it with this:
$content = $pages[$page-1];
$content = explode(‘<!–more–>’, $content, 2);
$output = “”;
$output .= $content[0];
$output .= get_the_password_form();
return $output;
This next step is optional, but I think it makes it nicer.
In the get_the_password_form function, find the following text (may vary between versions):
This post is password protected.
And replace it with this:
The rest of this post is password protected.
Or whatever text you would like it to show.