views:

150

answers:

1

Hi guys,

I'm trying to edit the template page which is used when a page or post is password protected. I can't seem to have much luck locating it.

do you know where it is?

+2  A: 

It's my understanding that the password protected pages/posts use the same templates are regular pages/posts. If you're looking to change the standard message "My post is password protected. Please ask me for a password:", try adding this code snippet (changing the text to read how you want) to your theme's function.php file:

function fb_the_password_form() {
    global $post;

    $label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID);
    $output = '<form action="' . get_option('siteurl') . '/wp-pass.php" method="post">
    <p>' . __("My post is password protected. Please ask me for a password:") . '</p>
    <p><label for="' . $label . '">' . __("Password") . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr__("Submit") . '" /></p>
    </form>';

    return $output;
}
add_filter('the_password_form', 'fb_the_password_form');

I found this over at Change Wording for Password Page by WP Engineer.

Manzabar