0

I need some help if it's possible. Each page of my website are protected with a password, i use protected password page.

Page link : http://builder.depretz.com/onepage-hotelenter image description here

You can see the custom code i use.

CUSTOM CODE :

#custom password page

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" style="font-size:56px;margin:20px;text-align:center;">
    ' . __( "" ) . '
    <img src="http://builder.depretz.com/wp-content/uploads/2017/05/mb.png" border="0" />
    <label for="' . $label . '">' . __( "" ) . ' </label><input name="post_password" id="' . $label . '" type="password"  style="background: #ffffff; border:1px solid #999; color:#333333; padding:10px;margin:auto;width:40%;height: 50px;"  size="20" maxlength="20" /><input style="width:40%;height:50px;Background:##263bda;border:#d8c217" type="submit" name="Submit" value="' . esc_attr__( "GO" ) . '" />
    </form>
    <p style="font-size:14px;margin:10px;text-align:center;">THE PASSWORD IS SENSITIVE TO THE CASE  </p>

    ';
    return $o;
}
add_filter( 'the_password_form', 'my_password_form' );

#remove title on protected page

function remove_protected_in_title($title) {
    return '';
}

add_filter('private_title_format', 'remove_protected_in_title');
add_filter('protected_title_format', 'remove_protected_in_title');

?>

I want to use ACF (Advanced Custom Field) to create personalization background for each page. so creating a custom field box on admin page and link it with the background of protected page. (like the attachment picture).

enter image description here

Each page will have it's own background on the protected page. Is it possible?

Thanks in advance for the answer.

2
  • Yes, it is possible. – Milo May 26 '17 at 16:10
  • Can you give me idea about custom code to add on function.php for that? – sampaii May 26 '17 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.