M
M
MRcracker2020-08-07 23:35:06
Layout
MRcracker, 2020-08-07 23:35:06

How to display comments in wordpress?

Made a small form of comments. Tell me how to remove the standard comment field from it? How to add col classes to a given comment field so that all fields are in one col, and the comment form is in another col?

$commenter = wp_get_current_commenter();
  $req = get_option( 'require_name_email' );
  $aria_req = ( $req ? " aria-required='true'" : '' );
    $fields =  array(
    'author' => '<p class="comment-form-author">' .
    '<input id="author" name="author" type="text" placeholder="Введите ваше имя" value="'  . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
    'email'  => '<p class="comment-form-email">'  .
    '<input id="email" name="email" type="text" placeholder="Введите ваш e-mail" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
    'site' => '<p class="comment-form-site">' .
    '<input id="author" name="author" type="text" placeholder="Введите ваш сайт (не обязательно)" value="'  . esc_attr( $commenter['comment_author_site'] ) . '" size="30"' . $aria_req . ' /></p>',
    'comments' => '<p class="comment-site">' .
    '<textarea id="comment" class="comment" name="author" type="text" placeholder="Введите ваш комментарий" value="'  . esc_attr( $commenter['comment'] ) . '" size="30"' . $aria_req . ' /></textarea></p>',
    
  );

  $comments_args = array(
    'fields' =>  $fields
  );

  comment_form($comments_args);

?>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question