Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save khikrama/454dc5a360f3b6356954 to your computer and use it in GitHub Desktop.
Save khikrama/454dc5a360f3b6356954 to your computer and use it in GitHub Desktop.
function wpsites_modify_comment_form_fields($fields){
$fields['author'] = '<p class="comment-form-author">' . '<label for="author">' . __( 'Author', 'wpsites.net' ) . '</label> ' .
( $req ? '<span class="required">*</span>' : '' ) .
'<input id="author" name="author" type="text" placeholder="Real name, please, no keyword spamming!" value="' .
esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>';
$fields['email'] = '<p class="comment-form-email"><label for="email">' . __( 'Address', 'wpsites.net' ) . '</label> ' .
( $req ? '<span class="required">*</span>' : '' ) .
'<input id="email" name="email" type="text" placeholder="Preferably Linked To Your Gravatar.com Account" value="' .
esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>';
$fields['url'] = '<p class="comment-form-url"><label for="url">' . __( 'Domain', 'wpsites.net' ) . '</label>' .
'<input id="url" name="url" type="text" placeholder="Please Link To Your Own Domain" value="' .
esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>';
return $fields;
}
add_filter('comment_form_default_fields','wpsites_modify_comment_form_fields');
@khikrama
Copy link
Author

khikrama commented Apr 7, 2015

Add this code in wordpress theme functions.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment