I have password protected some post on a site and in order to customize the text of the password protected post I have added this codes in my theme's function file;
<?php
function my_password_form() {
global $post;
$label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );
$o = '<form action="' . esc_url( site_url('wp-login.php?action=postpass', 'login_post' ) ) . '" method="post">
' . __( "To view this protected post, enter the password below:" ) . '
<label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" maxlength="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" />
</form>';
return $o;
}
add_filter( 'the_password_form', 'my_password_form' );
?>
Now in order to ward away from hackers also I have .htaccess files with password protection feature:
<Files wp-login.php>
Satisfy All
AuthType Digest
AuthName "Restricted!"
AuthDigestDomain /wp-admin/
AuthUserFile /home3/domain/.htpasswda3
Require valid-user
</Files>
Is there a way to bypass this htaccess rule for password protected post so that both can co-exist together.
Suggestion