Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1050925

    Hi there,
    I would like to remove the “website” box from the comments area on each blog post and would also like to format it so it looks like the “Subscribe to Blog” section, can you help please?
    I have attached images of the sections below and login details for my site.
    Many thanks
    H

    #1051610

    Hey hbourdillon,
    To remove the “website” field, Please add this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:

    .comment_container p.comment-form-url {
    display: none !important;
    }

    To format the comments fields to look like the ‘Subscribe to Blog’ section, we will first need to hide the labels with this css:

    .comment_container label[for=author],.comment_container label[for=email] {
    display: none !important;
    }

    Then we will need to add the placeholders in the fields, by adding this code to the end of your functions.php file in Appearance > Editor:

    function add_placeholders(){
      ?>
      <script>
      function placeholders() {
      document.querySelector("input#author")
      .setAttribute("placeholder", "Name");
      document.querySelector("input#email")
      .setAttribute("placeholder", "email");
    }
    $(document).ready(placeholders);
      </script>
      <?php
      }
      add_action('wp_footer', 'add_placeholders');

    Here’s the expected results:
    2019-01-09-005324
    After you add this code, Please clear your browser cache.

    Best regards,
    Mike

    #1052074

    Hi Mike,
    Thank you for your help with this!
    I got as far as putting the code into the Functions.php file in Editor but it hasn’t added in the placeholders and it seems to have slowed the Blog page down massively so I have now removed that bit of code. Any thoughts on why?
    Could we also make the Name and Email boxes full width?
    Also, I’d like to make the “Save my name, email (and website – delete this text) text and the “I agree to the terms etc” the default size for the website as well as making the “post comment” box full width…
    Best wishes
    H

    #1052163

    Hi,
    I rewrote the placeholder script and added it and it seems to be working correctly now:

    function add_placeholders(){
    ?>
    <script>
    (function($){
    $(document).ready(function(){
    $(".comment-form-author input#author").attr("placeholder", "Name");
    $(".comment-form-email input#email").attr("placeholder", "email");
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_placeholders');

    To make the name and email field and submit button full width, I added this in your Quick CSS:

    #top .comment-form-email input, #top .comment-form-author input,#top .comment_container .form-submit input.submit {
        width: 100% !important; 
    }

    To correct the font size for the checkbox text, I added this Quick CSS:

    #top label[for=wp-comment-cookies-consent], #top label[for=comment-form-av-privatepolicy] {
        font-weight: bold !important; 
        font-size: 0.92em !important; 
    }

    To remove the text “and website” from the label, I added this script to your functions.php:

    function replace_consent_text(){
    ?>
    <script>
    (function($){
    $(document).ready(function(){
    $("label[for=wp-comment-cookies-consent]").text("Save my name and email in this browser for the next time I comment.");
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'replace_consent_text');

    Please clear your browser cache and check.

    Best regards,
    Mike

    #1052269

    Hi Mike,
    Thank you so much!
    Couple more tweaks if possible:
    I don’t think the tick box and “Save my name and email in this browser for the next time I comment.” are particularly relevant, could we remove them?
    I’d like it to say “Comment” in the comment box and have tried copying the code for the Name and Email boxes but to no avail I’m afraid…
    Please could I have code to make the “Post Comment” button the same height and with the same size font as the subscribe button below?

    Looking at the section on a mobile, the “Privacy Policy” tick box line is half covered by the “Post Comment box…
    Thank you for all your assistance!
    Best wishes
    H

    #1052332

    Hi,
    To remove the “comment-form-cookies-consent” check box, I went to WordPress > Settings > General > Discussion Settings > Show comments cookies opt-in checkbox and unchecked it, and I removed the script that changed the wording.
    I then updated the comment form to show a placeholder, and the font size for the submit button, and the mobile view of the “Privacy Policy” tick box line.

    Please clear your browser cache and check.

    Best regards,
    Mike

    #1052333

    Dear Mike,
    You are an absolute star! It looks perfect on the desktop and mobile view.
    Thank you so much.
    Best wishes
    H

    #1052548

    Hi,
    Thank you, I’m glad to help.
    I assume that we can close this now, but I like a ask first, so shall we close this then?

    Best regards,
    Mike

    #1052692

    All done thank you Mike, please close.
    Best wishes
    H

    #1052739

    Hi,
    Glad we were able to help, we will close this now. Thank you for using Enfold.

    For your information, you can take a look at Enfold documentation here
    For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)

    Best regards,
    Mike

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Remove Website box from Blog Comments and change format’ is closed to new replies.