You can change that in wp-includes/post-template.php around line 1141. Look for this: <p>' . __("This post is password protected. To view it please enter your password below:") . '</p>
and change it to this:
<p>' . __("Whatever you'd like it to say") . '</p>
Keep in mind though that changing that text will change it globally, meaning whatever you change it too will appear on any post or page that is password protected.
Hope that helps!
Thread Starter
Harty
(@harty)
Thank you happywifenmama. Just the job.
Add the following to your Functions.php file under your theme folder:
// Password Protected Page Message
function custom_password_form($form) {
$subs = array(
'#<p>This post is password protected. To view it please enter your password below:</p>#' => '<p>Hopefully this works.</p>',
'#<form(.*?)>#' => '<form$1 class="passwordform">',
'#<input(.*?)type="password"(.*?) />#' => '<input$1type="password"$2 class="text" />',
'#<input(.*?)type="submit"(.*?) />#' => '<input$1type="submit"$2 class="button" />'
);
echo preg_replace(array_keys($subs), array_values($subs), $form);
}
add_filter('the_password_form', 'custom_password_form');
I’ve followed the above steps and they’ve worked beautifully.
thx.
Is there anyway to make a hyperlink… ie
Here’s what I did. I think you can see the hyperlink I want
——
This special information has been reserved for subscribers to this blog.
For subscription details please visit http://www.escapetoprosperity.com/subscribe/.
Your password details will be emailed to you in just a few minutes.
Welcome to our community.
—–
thx,
Rob
Thanks happywifenmama – that did it for me !
on a sidenote: Keep in mind that updates to that particular file
wp-includes/post-template.php
will be erased through WordPress updates, as it’s one of the core files.
The method suggested by garethooper therefore is better.
Thanks for the filter garethooper! Native WP hooks should be better documented in the codex, but I guess that’s what the forums are for.
ditto rsciw. I was just looking up how to change the default This post is password protected… to something different. Be best to keep things like this local to theme and not mess with the WP core files.
Besides, he’s right. An upgrade will wipe out all those customizations.
Thanks garethooper.