-
-
Hey there,
it’s me again. I want to protect a special site with a password. But how can i customize the password protection formular? It’s looks pretty bad. Which function is responsible for this? I have no idea where to start 🙄
This is what it looks now:
-
Hello,
What plugin are you using to add the restriction? This is not part of theme default settings so it’s not covered from support. But you can customize anything using custom css. Just add the code in the Appearance > Customize > General > Custom Codes > Custom Css.
Best regards!
-
Hey Mirela,
i’m not using a plugin. This is a standard feature from wordpress in the settings for a site. So i was wondering why this is not covered in the theme. And the problem with the custom css is, that i can’t change the wording etc.
As you can see, it’s under visibility (Sichtbarkeit).
-
Hello,
You are right. Please add a link to your site. What exactly do you want to change in its design?
Best regards!
-
-
Hello,
I am not sure how can I help now… The link you send has already the button style as the image attached (screenshot).
The code to customize the button is:.btn-layout-medium { margin-left: 10px; } .cl-btn:not(.btn-priority_secondary) { background-color: rgba(0,0,0,0); color: #0a0a0a; border-color: #1e1e1e; border-width: 1px; font-weight: 600; } .post-password-form { width: 50%; margin: 0 auto; padding-top: 20px; padding-bottom: 40px; }
..in case you want to further change it. Please let me know what change you want to do it further so i can help.
Best regards!
-
-
Hello,
The text is hardcoded in theme files. So to change it go to file: folie\includes\codeless_functions_blog.php
Find the functioncodeless_password_form()
:function codeless_password_form( $post ){ $post = get_post( $post ); $label = 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID ); $output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post"> <p>' . esc_html__( 'This content is password protected. To view it please enter your password below:', 'folie' ) . '</p> <p><label for="' . $label . '">' . esc_html__( 'Password:', 'folie' ) . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" class="'.codeless_button_classes().'" value="' . esc_attr_x( 'Enter', 'post password form', 'folie' ) . '" /></p></form> '; return $output; }
Edit to this:
function codeless_password_form( $post ){ $post = get_post( $post ); $label = 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID ); $output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post"> <h2>' . esc_html__( 'Dieser Bereich ist Passwortgeschutzt.', 'folie' ) . '</h2> <span>' . esc_html__( 'Sorry, Rechte und so.', 'folie' ) . '</span><span style="color: #03A9F4;">' . esc_html__( 'Gib bitte das Passwort ein.', 'folie' ) . '</span> <p><label for="' . $label . '"><input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" class="'.codeless_button_classes().'" value="' . esc_attr_x( 'Enter', 'post password form', 'folie' ) . '" /></p></form> '; return $output; }
Then add this custom css:
.cl-btn:not(.btn-priority_secondary):hover { background-color: rgb(255, 255, 255) !important; color: #504c4c !important; border-color: rgba(0, 0, 0, 0.48) !important; } .cl-btn:not(.btn-priority_secondary) { background-color: rgb(255, 255, 255) !important; color: #504c4c !important; border-color: rgba(0, 0, 0, 0.48) !important; } h2:not(.custom_font), .h2 { font-size: 28px !important; line-height: 24px !important; text-transform: none !important; font-weight: 600 !important; letter-spacing: 0px; color: #585454 !important; }
Change the values to your wish.
Best regards! -
-
Hello,
Sorry but this file can not be overwritten in a child theme. I suggest you save a copy of it in your computer/server to replace the function in case of a theme update.
Best regards!
-
It was a bit more complicated, but it worked!
Thank you so much! 😊
-
You’re welcome :)
If you like our theme and support, please leave us a rating on Themeforest, it’s very important for us :)
https://themeforest.net/downloads
Thank You so much!
-
You must be logged in to reply to this topic.