Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter monicapaula

    (@monicapaula)

    Hi. I already found the answer. Maybe my files weren’t compatible that’s why it didn’t work but here is the full code.

    <?php
        function my_password_form() {
            global $post;
            $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );
            $o = '<form action="' . get_option('siteurl') . '/wp-login.php?action=postpass" 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' );
        ?>

    NOTE : I am using WordPress 3.9.2

Viewing 1 replies (of 1 total)