RE: How to change comment form style in wordPress?

How to change comment form style in wordPress?

dip Team Leader Asked on March 4, 2017 in WORDPRESS.
Add Comment
1 Answers

The template called comments.php which is used to display comments and comment form on your blog posts/pages. The comment form is generated using the function <?php comment_form(); ?>.

Changing Comment Form Style in WordPress:
Step 1: Updating by css
The simplest way to change the comment form style is modify each of the fields by updating the the default CSS classes or Ids

#respond { }

#reply-title { }

#cancel-comment-reply-link { }

#commentform { }

#author { }

#email { }

#url { }

#comment {}

#submit {}

.form-submit {}

.required { }

.comment-form-author { }

.comment-form-email { }

.comment-form-url { }

.comment-form-comment { }

Step 2: Updating by HTML


$args = array(

'comment_field' => '<div class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>'

'fields' => apply_filters( 'comment_form_default_fields', array(
'author' =>

'<div class="comment-form-author">' .

'<label for="author">' . __( 'Name', 'domainreference' ) . '</label> ' .

( $req ? '<span class="required">*</span>' : '' ) .

'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) .

'" size="30"' . $aria_req . ' /></p>',
'email' =>

'<div class="comment-form-email"><label for="email">' . __( 'Email', 'domainreference' ) . '</label> ' .

( $req ? '<span class="required">*</span>' : '' ) .

'<input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) .

'" size="30"' . $aria_req . ' /></p>',
'url' =>

'<div class="comment-form-url"><label for="url">' .

__( 'Website', 'domainreference' ) . '</label>' .

'<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) .

'" size="30" /></p>'

)
);

comment_form( $args );

Team Leader Answered on March 5, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.