How to add placeholder into comment form textarea?
Use the filter comment_form_fields instead of comment_form_defaults. Also, in the call to str_replace(), remove the =”” from required in both strings. So, your code will become: function custom_comment_form_placeholders( $fields ) { if ( isset( $fields[‘comment’] ) ) { $fields[‘comment’] = str_replace( ‘<textarea id=”comment” name=”comment” cols=”45″ rows=”8″ maxlength=”65525″ required></textarea>’, ‘<textarea id=”comment” name=”comment” cols=”45″ rows=”8″ maxlength=”65525″ required … Read more