For customization default wordpress comment form:
In comment.php
$args = array(
'fields' => apply_filters(
'comment_form_default_fields', array(
'author' => '<div class="default-form"><div class="col-md-6 col-sm-6 col-xs-12 form-group padding-none">' . '<input id="author" class="form-control" placeholder="Name*" name="author" type="text" value="' .
esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' />' .
'' .
( $req ? '' : '' ) .
'</div>',
'email' => '<div class="col-md-6 col-sm-6 col-xs-12 form-group padding-none">' . '<input id="email" class="form-control" placeholder="Email*" name="email" type="text" value="' . esc_attr($commenter['comment_author_email']) .
'" size="30"' . $aria_req . ' />' .
' ' .
( $req ? '' : '' )
.
'</div></div>',
)
),
//'title_reply' => '<h5>Leave a Comment</h5>',
'comment_field' => '<div class="col-md-12 col-sm-12 col-xs-12 form-group default-form">' .
'' .
'<textarea id="comment" name="comment" required="required" class="form-control textarea required" placeholder="Message" aria-required="true"></textarea>' .
'</div>',
'comment_notes_before' => '',
'title_reply' => '<h3>Leave a Comment</h3>',
'comment_notes_after' => '<div class="col-md-12 col-sm-12 col-xs-12 form-group"><div class="form-bottom"><button type="submit" id="submit-new" class="btn btn-default hvr-sweep-to-right" name="Send Message">' . __('<i class="li_paperplane"></i>Send message') . '</button></div></div>'
//'comment_notes_after' => '<div class="span4"><button class="btn" id="submit-new" type="button"><i class="li_paperplane"></i>Send message</button></div></div>'
//'comment_notes_after' => '<div class="col-md-12 col-sm-12 col-xs-12"><div class="form-group form-bottom"><button class="btn btn-default hvr-sweep-to-right" id="submit-new" type="button">Send message</button></div></div></div>'
);
comment_form($args);
Add below line for customizing reply section in comment.php
<?php wp_list_comments('type=comment&callback=custom_pings'); ?>
custom_pings is the function for customizing reply section.
add below code in functions.php
/*
* Custom reply section
*/
/* Custom callback function for Trackbacks/Pings, see comments.php */
function custom_pings($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
$pic = get_template_directory_uri() . '/assets/images/default-user.png';
?>
<div <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div id="comment-<?php comment_ID(); ?>" class="comment">
<div class="comment-box">
<figure>
<?php echo get_avatar($comment, $size = '100', $default = $pic); ?>
</figure>
<h6><?php printf(__('<cite class="fn">%s</cite>'), get_comment_author_link()) ?></h6>
<span><i class="fa fa-calendar" aria-hidden="true"></i><?= get_comment_date('M d, Y') ?></span>
<?php comment_text() ?>
<?php if ($comment->comment_approved == '0') : ?>
<p><?php _e('Your comment is awaiting moderation.') ?></p>
<?php endif; ?>
<?= comment_reply_link(array_merge($args, array('depth' => 1, 'max_depth' => $args['max_depth']))) ?>
</div>
</div>
</div>
<?php
}
Show Comments
