• Resolved Madd1974

    (@madd1974)


    Hello,
    I have the problem, that the new WordPress Checkbox (to save the comment-data in the browser) below the comment form is not displayed on my website, where I use the hemmingway theme.

    Does someone else has this problem?

    thanks,
    Peer

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello,

    Yes. This is because the theme (re-)creates the comment form, therefore any changes by WordPress will not be seen. The only reason seems to be that the theme adds the placeholder attribute to the input fields, because the label is hidden. Hopefully, the author of the theme will update this soon.

    For now, I have fixed it myself manually as follows. You can do this yourself under Appearance -> Editor and selecting the theme. I suggest do use a child theme.

    • comment out lines 89-100 in Hemingway’s Comments.php file
    • in my child theme’s functions.php I added the following code to add the placeholder attribute to author and email (I hide the URL field, but it is easy to do it for that as well):
      function addPlaceholderName($field) {
          return addPlaceholder($field, __('Name','Hemingway'));
      }
      
      function addPlaceholderEmail($field) {
          return addPlaceholder($field, __('Email','Hemingway'));
      }
      
      function addPlaceholder($field, $text) {
          $position = strpos($field, 'value="');
          $newField = substr_replace($field, 'placeholder="' . $text . '"', $position, 0);
      
          return $newField;
      }
      
      add_filter('comment_form_field_author', 'addPlaceholderName');
      add_filter('comment_form_field_email', 'addPlaceholderEmail');
    • now the checkbox should appear, but not the label for it. Therefore, add the following to your style.css:
      p.comment-form-cookies-consent label {
          display: inline !important;
          margin-left: 0.5em;
          vertical-align: -1px;
      }

    Hope this helps.

    • This reply was modified 6 years, 10 months ago by mattsch.
    • This reply was modified 6 years, 10 months ago by mattsch.
    • This reply was modified 6 years, 10 months ago by mattsch. Reason: improved code reuse
    Thread Starter Madd1974

    (@madd1974)

    Thank you, its working.

    Theme Author Anders Norén

    (@anlino)

    Hi @madd1974,

    I’ve submitted an update to Hemingway that fixes the output of the checkbox in 4.9.6.

    — Anders

    Hello,

    I’ve the same problem with RoseMary theme.

    And i’ve not enough informatics knowledge to fix in with a code modification !

    How can i do ?

    Thanks

    Theme Author Anders Norén

    (@anlino)

    Hi @laurahantz,

    You’ll have to ask the developer of your theme. I can’t help you, unfortunately.

    — Anders

    Thank for the answer ??

    Hi @anlino,

    Can you also fix it for the Hemingway Rewritten theme? I can see that there was an update to the theme June 1, but the checkbox doesn’t show. I have run all the WP updates. Many thanks in advance!

    Theme Author Anders Norén

    (@anlino)

    Hi @beatravelling,

    The Hemingway Rewritten version of the theme is maintained by Automattic (the company behind WordPress.com), so you’ll have to get in touch with them for support. You can find the support portal for WordPress.com here: https://en.support.wordpress.com

    — Anders

    @anlino

    Oh, sorry, was not aware of that. Will take it to the other support forum. Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Comment-Checkbox in WP 4.9.6 – not displayed’ is closed to new replies.