Codeless
  • Support Home
  • Themes
  • Support
  • WordPress Tutorials
    • How to Start a Blog
    • Best Website Builders
    • Best Small Business Hosting
    • Email Marketing Services
    • Cheap WordPress Hosting
  • Video Tutorials

Community Forums

Customize password protection

customizepassword protection
    • 5 years, 7 months ago Navid
      Participant

      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:

    • 5 years, 7 months ago Mirela
      Participant

      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!

    • 5 years, 7 months ago Navid
      Participant

      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).

    • 5 years, 7 months ago Mirela
      Participant

      Hello,

      You are right. Please add a link to your site. What exactly do you want to change in its design?

      Best regards!

    • 5 years, 7 months ago Navid
      Participant
      This reply has been marked as private.
    • 5 years, 7 months ago Mirela
      Participant

      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!

    • 5 years, 7 months ago Navid
      Participant
      This reply has been marked as private.
    • 5 years, 7 months ago Mirela
      Participant

      Hello,

      The text is hardcoded in theme files. So to change it go to file: folie\includes\codeless_functions_blog.php
      Find the function codeless_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!

    • 5 years, 7 months ago Navid
      Participant
      This reply has been marked as private.
    • 5 years, 7 months ago Mirela
      Participant

      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!

    • 5 years, 7 months ago Navid
      Participant

      It was a bit more complicated, but it worked!

      Thank you so much! 😊

    • 5 years, 7 months ago Mirela
      Participant

      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!

Viewing 11 reply threads

You must be logged in to reply to this topic.

Login

Log In
Register

Renew Support

  • Renew Specular Support
  • Renew Tower Support
  • Renew Folie Support
  • Renew Handel Support
  • Renew June Support
  • Renew Picante Support
  • Renew Thype Support
  • Renew Regn Support

Search Forums

Forums

  • Bygge – Construction Theme
  • Converta – Software Theme
  • Folie – The WordPress Website Builder
  • Handel – Responsive Multi-Purpose Business Theme
  • June WooCommerce WordPress Theme
  • Livecast – Podcast Theme
  • Picante – Restaurant & Food WordPress Theme
  • Regn | Agency & Business WordPress Theme
  • Remake – Minimal Portfolio & Agency Theme
  • Specular – Multi-Purpose WordPress Theme
  • Suggest us Features
  • Tower – Business-Driven Multipurpose WP Theme
  • Vibrance – Photography Theme

Site Links

  • Support Policy
  • Specular Support Forum
  • Video Tutorials
  • Knowledge Base
  • Guides and Reviews

Useful Articles

  • Build a Website
  • Web Design & Development
  • Hosting
  • WordPress

Login

Log In
Register Lost Password