• Facing an age old problem here.

    When i view password protected page, i see “Enter password to view comments” in BIG h1 style and looks ugly. I would like to get rid of this or style it to display:none in css.

    I used this hook to remove this text in functions.php and it aint helping. Nothing changes.

    <?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' );
    ?>

    Is there a way?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter olddocks

    (@olddocks)

    Update: I checked this using firebug and it shows like this.

    <div class="totalcomments">
    Enter your password to view comments.
    <span class="commentname">COMMENTS</span>
    </div>

    What happens if you put

    .totalcomments {
        display: none;
    }

    in your style.css?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fixing – Enter password to view comments’ is closed to new replies.