• I am a photographer and am trying to password protect albums (which are ultimately new pages that are password protected). I though I had figured it out with a filter in php and then added a class in css, so now I have it looking the way I want, but once I enter the password, I get an error that reads:
    ‘Warning: Cannot modify header information – headers already sent by (output started at /home2/dreamwe6/public_html/wp-content/themes/Dream-Photo-Theme/functions.php:12) in /home2/dreamwe6/public_html/wp-pass.php on line 16’

    Here’s the php I’m using:

    <?php
    add_filter( 'the_password_form', 'custom_password_form' );
    function custom_password_form() {
    	global $post;
    	$label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );
    	$o = '<form class="protected-post-form" action="' . get_option('siteurl') . '/wp-pass.php" method="post">
    	' . __( "This album is password protected. <br/> To view the album please enter the groom's last name:" ) . '
    	<label for="' . $label . '">' . __( "" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" />
    	</form>
    	';
    	return $o;
    }
    ?>

    Any help?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Password protected post w/ CSS styling’ is closed to new replies.