Skip to content

Instantly share code, notes, and snippets.

@zainaali
Created September 27, 2018 10:33
Show Gist options
  • Save zainaali/a899cd1bddc6a3b0b32c8c85707ab8d9 to your computer and use it in GitHub Desktop.
Save zainaali/a899cd1bddc6a3b0b32c8c85707ab8d9 to your computer and use it in GitHub Desktop.
Add class and placeholder to name and email field of Wordpress comment template
$fields = array(
'author' => '<ul class="row"><li class="col-sm-6"><label>' . '<input class="form-control" id="author" name="author" type="text" placeholder="' . esc_attr__( "Name", "text-domain" ) . '" value="' . esc_attr( $commenter['comment_author'] ) . '" size=""' . $aria_req . ' /></label></li>',
'email' => '<li class="col-sm-6"><label>' . '<input class="form-control" name="email" type="text" placeholder="' . esc_attr__( "Email", "text-domain" ) . '" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size=""' . $aria_req . ' /></label></li>',
);
comment_form(array('fields'=>$fields));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment