Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #111532
    Pascal
    Participant

    Hey,

    first of all thank you very much for such an amazing free theme!

    Since the last update (1.3 to 1.4) the placeholders for the comments are missing. Since the labels are set to display:none via styles.css, the user has no way to know which fields are for name, email, and URL. I suspect this has to do with the file js/helper.js which is missing in 1.4.

    Could you bring back the placeholders (preferred) or make the labels visible?

    Thank you very much!

    -Pascal

    #111596
    Mahesh
    Keymaster

    @pascal: The change was done to avoid some difficulty that changing the placeholder values through child theme. And since it was hard coded through js in the before version. It was removed. But you and customize it using child theme. You can find more details on creating child theme HERE. Then in your child theme’s functions.php add the following codes:

    /* Add Placehoder in comment Form Fields (Name, Email, Website) */
     
    add_filter( 'comment_form_default_fields', 'help4cms_comment_placeholders' );
    function help4cms_comment_placeholders( $fields )
    {
        $fields['author'] = str_replace(
            '<input',
            '<input placeholder="Name..."',
            $fields['author']
        );
        $fields['email'] = str_replace(
            '<input',
            '<input placeholder="[email protected]..."',
            $fields['email']
        );
        $fields['url'] = str_replace(
            '<input',
            '<input placeholder="Website..."',
            $fields['url']
        );
        return $fields;
    }
     
    /* Add Placehoder in comment Form Field (Comment) */
    add_filter( 'comment_form_defaults', 'help4cms_textarea_placeholder' );
     
    function help4cms_textarea_placeholder( $fields )
    {
      
            $fields['comment_field'] = str_replace(
                '<textarea',
                '<textarea placeholder="Your thoughts.."',
                $fields['comment_field']
            );
       
     
        return $fields;
    }

    Note: Replace the placeholder values as you desire.

    Regards,
    Mahesh

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Comment Placeholder Missing’ is closed to new replies.