Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1254398
    Antoine
    Participant

    Hello,

    I’d like to change the text and the button of the protect block. How can I do it?

    I’d like to change all the texts (“Restricted Content Login”, “Username” and “Password”) and the button.

    Thank you.

    #1254593
    Nabeel A
    Moderator

    Hi there,

    Thanks for writing in! Please add the following jQuery script in your Customizer via Appearance > Customize > Custom > Edit Global Javascript

    jQuery(document).ready(function($){
    	$('.h-protect').html("Change Title text");
    	$('.x-protect form div:nth-child(2) label').html("Change Username Text");
    	$('.x-protect form div:nth-child(3) label').html("Change Password Text");
    	$('.x-btn-protect').attr("value", "Change Btn Text");
    });

    Change the text as per your need in the above code. Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!

    #1254613
    Antoine
    Participant

    I did the trick, thank you.

    How can I assign a class to the button so that I change its appearance?

    #1254637
    Nabeel A
    Moderator

    Hi again,

    Glad it worked. To assign a custom class to the button, just replace the previous code with this:

    jQuery(document).ready(function($){
    	$('.h-protect').html("Change Title text");
    	$('.x-protect form div:nth-child(2) label').html("Change Username Text");
    	$('.x-protect form div:nth-child(3) label').html("Change Password Text");
    	$('.x-btn-protect').attr({"value": "Change Btn Text", "class": "btnClass"});
    });

    Then you can use .btnClass to style the button as per your need.

    Cheers!

    #1254744
    Antoine
    Participant

    It did the trick, thank you.

    How can I assign a class to the button so that I change its appearance?

    #1254986
    Rue Nel
    Moderator

    Hello There,

    Thanks for updating in! If you want to display custom look for the button, you can add this custom css;

    .btnClass{
      /* add your styling here
       * like color, background color, borders and more */
    }

    And to have more control over the protected block content element, you might be interested in checking out this thread: https://community.theme.co/forums/topic/restricted-content-can-i-add-a-forgot-password-link/#post-804483

    Hope this helps.

    #1255047
    Antoine
    Participant

    Thank you very much for the great support!

    #1255051
    Christopher
    Moderator

    You’re welcome.

  • <script> jQuery(function($){ $("#no-reply-1254398 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>