• I’ve edited /wp-includes/comments-template.php so that I have some br tags between the form labels and the input elements, but I know this is wrong because it should be somewhere in the theme files. How would I properly customize/extend the comments_form function? Do I just copy and paste the comments form function to my functions.php file, and make my changes there?

Viewing 1 replies (of 1 total)
  • Thread Starter skunkbad

    (@skunkbad)

    I figured it out myself. I just added in some arguments to the function call:

    <?php
        comment_form(
            array(
                'fields' => array(
                                'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) .
                                            '<br />
                                            <input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
                                'email'  => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) .
                                            '<br />
                                            <input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
                                'url'    => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label>' .
                                            '<br />
                                            <input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>',
                )
            )
        );
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘How to add some br tags to comments form’ is closed to new replies.