Try adding something like:
function my_password_form() {
global $post;
$label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID);
$output = '<div class="password-form">
<p class="protected-text">' . __('This post is password protected. To view it, please enter your password below:') . '</p>
<form action="' . get_option('siteurl') . '/wp-pass.php" method="post">
<p><label for="' . $label . '">' . __('Password:') . ' </label> <input name="post_password" id="' . $label . '" type="password" size="20" /> <input type="submit" name="submit" value="' . esc_attr__('Submit') . '" /></p></form></div>';
return $output;
}
add_filter('the_password_form','my_password_form');
to your theme’s functions.php file
Thread Starter
dtlyme
(@dtlyme)
As always thank you Esmi. You are a great teacher and that worked beautifully! I made a ‘custom-functions.php’ and used your code. Perfection!
The form action points to a wp-pass.php file which does not exist in current versions of WordPress.